mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-04-15 23:52:23 -06:00
* Refactor nav, breadcrumbs, children_nav Fix #1118 Improve the modularity of building the nav-panel, breadcrumbs, and children-nav by making them independent. This also significantly simplifies the Liquid code. * Fix order of breadcrumbs * Update breadcrumbs.html Revert inclusion of single breadcrumb for top-level pages. * Update breadcrumbs.html * Update children_nav.html Revert to the previous layout in the HTML, to allow the use of `diff` to check the built site. * Update minimal.html Remove the previously required workaround involving `nav.html`. * Add docs pages about layouts The aim of the initial version of these docs pages is to illustrate the difference between the default and minimal layouts. * Update CHANGELOG.md
34 lines
970 B
HTML
34 lines
970 B
HTML
{%- comment -%}
|
|
Include as: {%- include components/children_nav.html -%}
|
|
Depends on: page, site.
|
|
Results in: HTML for the children-navigation component.
|
|
Includes:
|
|
sorted_pages.html
|
|
toc_heading_custom.html
|
|
Overwrites:
|
|
child_pages.
|
|
{%- endcomment -%}
|
|
|
|
{%- if page.has_children == true and page.has_toc != false -%}
|
|
{%- assign child_pages = site[page.collection]
|
|
| default: site.html_pages
|
|
| where: "parent", page.title
|
|
| where: "grand_parent", page.parent -%}
|
|
|
|
{%- include sorted_pages.html pages = child_pages -%}
|
|
|
|
{%- if page.child_nav_order == 'desc' or page.child_nav_order == 'reversed' -%}
|
|
{%- assign sorted_pages = sorted_pages | reverse -%}
|
|
{%- endif -%}
|
|
{%- endif -%}
|
|
|
|
<hr>
|
|
{% include toc_heading_custom.html %}
|
|
<ul>
|
|
{% for child in sorted_pages %}
|
|
<li>
|
|
<a href="{{ child.url | relative_url }}">{{ child.title }}</a>{% if child.summary %} - {{ child.summary }}{% endif %}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|