Make old-doc headers easily configurable
This commit is contained in:
parent
0310eb16bb
commit
371fe32662
2 changed files with 21 additions and 11 deletions
|
|
@ -169,22 +169,19 @@
|
||||||
{%- block body_tag %}<body>{% endblock %}
|
{%- block body_tag %}<body>{% endblock %}
|
||||||
{%- block header %}
|
{%- block header %}
|
||||||
|
|
||||||
|
{% if current_is_legacy %}
|
||||||
|
<div class="admonition important">
|
||||||
|
<p class="first admonition-title">Note</p>
|
||||||
|
<p class="last">You are reading an old version of the Evennia documentation. <a href="https://www.evennia.com/docs/latest/index.html">The latest version is here</a></p>.
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{%- block relbar1 %}{{ relbar() }}{% endblock %}
|
{%- block relbar1 %}{{ relbar() }}{% endblock %}
|
||||||
|
|
||||||
{%- block content %}
|
{%- block content %}
|
||||||
|
|
||||||
{% if legacy_versions %}
|
|
||||||
{% if release in legacy_versions %}
|
|
||||||
<div class="admonition note">
|
|
||||||
<p class="first admonition-title">Note</p>
|
|
||||||
<p class="last">You are reading an old version of this documentation.</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{%- block sidebar1 %} {# possible location for sidebar #} {% endblock %}
|
{%- block sidebar1 %} {# possible location for sidebar #} {% endblock %}
|
||||||
|
|
||||||
<div class="document">
|
<div class="document">
|
||||||
|
|
@ -210,7 +207,16 @@
|
||||||
{%- block relbar2 %}{{ relbar() }}{% endblock %}
|
{%- block relbar2 %}{{ relbar() }}{% endblock %}
|
||||||
|
|
||||||
{%- block footer %}
|
{%- block footer %}
|
||||||
|
|
||||||
|
{% if current_is_legacy %}
|
||||||
|
<div class="admonition important">
|
||||||
|
<p class="first admonition-title">Note</p>
|
||||||
|
<p class="last">You are reading an old version of the Evennia documentation. <a href="https://www.evennia.com/docs/latest/index.html">The latest version is here</a></p>.
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
|
|
||||||
{%- if show_copyright %}
|
{%- if show_copyright %}
|
||||||
{%- if hasdoc('copyright') %}
|
{%- if hasdoc('copyright') %}
|
||||||
{% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
|
{% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ author = "The Evennia developer community"
|
||||||
# This will be used for multi-version selection options.
|
# This will be used for multi-version selection options.
|
||||||
release = "2.x"
|
release = "2.x"
|
||||||
|
|
||||||
|
|
||||||
# -- General configuration ---------------------------------------------------
|
# -- General configuration ---------------------------------------------------
|
||||||
|
|
||||||
extensions = [
|
extensions = [
|
||||||
|
|
@ -68,11 +67,16 @@ legacy_versions = ["1.3.0", "0.9.5"]
|
||||||
|
|
||||||
def add_legacy_versions_to_html_page_context(app, pagename, templatename, context, doctree):
|
def add_legacy_versions_to_html_page_context(app, pagename, templatename, context, doctree):
|
||||||
# this is read by versioning.html template (sidebar)
|
# this is read by versioning.html template (sidebar)
|
||||||
|
|
||||||
|
# set this when building legacy docs, to show the 'you are reading an old version' headers
|
||||||
|
current_is_legacy = False
|
||||||
|
|
||||||
LVersion = namedtuple("legacy_version", ["release", "name", "url"])
|
LVersion = namedtuple("legacy_version", ["release", "name", "url"])
|
||||||
context["legacy_versions"] = [
|
context["legacy_versions"] = [
|
||||||
LVersion(release=f"{vers}", name=f"v{vers}", url=f"../{vers}/index.html")
|
LVersion(release=f"{vers}", name=f"v{vers}", url=f"../{vers}/index.html")
|
||||||
for vers in legacy_versions
|
for vers in legacy_versions
|
||||||
]
|
]
|
||||||
|
context["current_is_legacy"] = current_is_legacy
|
||||||
|
|
||||||
|
|
||||||
# -- Options for HTML output -------------------------------------------------
|
# -- Options for HTML output -------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue