mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-15 01:42:12 -05:00
Add sidebarsourcelink block.
This commit is contained in:
1 parent
350e5ff3c9
commit
f02a90ca6e
2 files changed
+6
No files matched your search
@@ -135,6 +135,10 @@ The following blocks exist in the ``layout`` template:
|
||||
`sidebarrel`
|
||||
The relation links (previous, next document) within the sidebar.
|
||||
|
||||
`sidebarsourcelink`
|
||||
The "Show source" link within the sidebar (normally only shown if this is
|
||||
enabled by :confval:`html_show_sourcelink`).
|
||||
|
||||
`sidebarsearch`
|
||||
The search box within the sidebar. Override this if you want to place some
|
||||
content at the bottom of the sidebar.
|
||||
|
||||
@@ -51,12 +51,14 @@
|
||||
<p class="topless"><a href="{{ next.link|e }}" title="{{ _('next chapter') }}">{{ next.title }}</a></p>
|
||||
{%- endif %}
|
||||
{%- endblock %}
|
||||
{%- block sidebarsourcelink %}
|
||||
{%- if show_source and has_source %}
|
||||
<h3>{{ _('This Page') }}</h3>
|
||||
<ul class="this-page-menu">
|
||||
<li><a href="{{ pathto('_sources/' + sourcename, true)|e }}">{{ _('Show Source') }}</a></li>
|
||||
</ul>
|
||||
{%- endif %}
|
||||
{%- endblock %}
|
||||
{%- if customsidebar %}
|
||||
{{ rendertemplate(customsidebar) }}
|
||||
{%- endif %}
|
||||
|
||||
Reference in new issue
Block a user