Docs improvements, allow setting more stuff outside of articles
This commit is contained in:
@ -45,25 +45,7 @@
|
||||
|
||||
{%- include "partials/statements.html" -%}
|
||||
|
||||
{%- if page.extra.toc -%}
|
||||
<h2>{{ macros_translate::translate(key="table_of_contents", default="Table of Contents", language_strings=language_strings) }}</h2>
|
||||
<ul>
|
||||
{%- for h1 in page.toc -%}
|
||||
<li>
|
||||
<a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
|
||||
{%- if h1.children -%}
|
||||
<ul>
|
||||
{%- for h2 in h1.children -%}
|
||||
<li>
|
||||
<a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
{%- endif -%}
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
{%- endif -%}
|
||||
{%- include "partials/toc.html" -%}
|
||||
|
||||
{{ page.content | safe }}
|
||||
</article>
|
||||
|
@ -1,6 +1,8 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ page.title }}</h1>
|
||||
{%- include "partials/statements.html" -%}
|
||||
{%- include "partials/toc.html" -%}
|
||||
{{ page.content | safe }}
|
||||
{% endblock content %}
|
||||
|
@ -122,7 +122,7 @@
|
||||
{%- set scripts = scripts | concat(with=["theme-switcher.js"]) %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if config.show_theme_switcher or config.languages | length > 0 %}
|
||||
{%- if config.extra.nav.links.sublinks or config.languages | length > 0 or config.extra.nav.show_theme_switcher %}
|
||||
{%- set scripts = scripts | concat(with=["details.js"]) %}
|
||||
{%- endif %}
|
||||
|
||||
|
37
templates/partials/toc.html
Normal file
37
templates/partials/toc.html
Normal file
@ -0,0 +1,37 @@
|
||||
{%- if page.extra.toc -%}
|
||||
<h2>{{ macros_translate::translate(key="table_of_contents", default="Table of Contents", language_strings=language_strings) }}</h2>
|
||||
<ul>
|
||||
{%- for h1 in page.toc -%}
|
||||
<li>
|
||||
<a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
|
||||
{%- if h1.children -%}
|
||||
<ul>
|
||||
{%- for h2 in h1.children -%}
|
||||
<li>
|
||||
<a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
{%- endif -%}
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
{%- elif section.extra.toc -%}
|
||||
<h2>{{ macros_translate::translate(key="table_of_contents", default="Table of Contents", language_strings=language_strings) }}</h2>
|
||||
<ul>
|
||||
{%- for h1 in section.toc -%}
|
||||
<li>
|
||||
<a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
|
||||
{%- if h1.children -%}
|
||||
<ul>
|
||||
{%- for h2 in h1.children -%}
|
||||
<li>
|
||||
<a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
{%- endif -%}
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
{%- endif -%}
|
@ -1,5 +1,8 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ section.title }}</h1>
|
||||
{%- include "partials/statements.html" -%}
|
||||
{%- include "partials/toc.html" -%}
|
||||
{{ section.content | safe }}
|
||||
{% endblock content %}
|
||||
|
Reference in New Issue
Block a user