Created
January 8, 2019 21:38
-
-
Save abitrolly/12522b399c92606d7b09e9342c3f788b to your computer and use it in GitHub Desktop.
Sphinx template override to link "View Source" to code repository
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
1. Place this to _templates/layout.html | |
2. Edit source_url_prefix below to point to your repo | |
Overriding Alabaster Theme to replace link to static page source | |
with a link to GitHub. Using instructions from official guide. | |
https://www.sphinx-doc.org/en/master/templating.html#jinja-sphinx-templating-primer | |
--> | |
{% set source_url_prefix = 'https://github.com/bitprophet/alabaster/tree/master/docs' %} | |
{% extends "!layout.html" %} | |
{%- block footer %} | |
<div class="footer" style="text-align: center"> | |
©{{ copyright }}.| | |
Powered by <a href="http://sphinx-doc.org/">Sphinx {{ sphinx_version }}</a> | |
& <a href="https://github.com/bitprophet/alabaster">Alabaster {{ alabaster_version }}</a> | |
(<a href="{{ source_url_prefix }}/_templates">customized</a>) | |
| | |
<a href="{{ source_url_prefix }}{{ pagename + ".rst"|e }}" | |
rel="nofollow">{{ _('View source') }}</a> | |
</div> | |
{%- endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment