You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I read the theme source for this but it was still a bit abstract. It would be nice to have this documented in the top-level docs in a way that shows what the theme designer intended.
The text was updated successfully, but these errors were encountered:
The 'extra.top' option is to set the navigation of the section's pages. Because the default navigation config of the Zola cannot find the previous or the next page in the nested section, the 'extra.top' is added to mark the page is the super page that has no parent pages.
You can read the related code in the file templates/macros/docs-navigation.html:
{% macro docs_navigation(page, current_section) %}
<divclass="docs-navigation d-flex justify-content-between">
{# Find lighter navigation. There are three types: #}
{# 1. directly find the lighter if exists, #}
{# 2. find the last page in the previous sibling section, and #}
{# 3. find the last page in the parent section. #}
{% if page.lighter %}
<ahref="{{ page.lighter.permalink }}"><divclass="card my-1"><divclass="card-body py-2">
← {{ page.lighter.title }}
</div></div></a>
{% elif not page.extra.top %}
{% set index = get_section(path=page.ancestors | reverse | first) %}
{% set parent = get_section(path=index.ancestors | reverse | first)%}
{% set first_subsection = get_section(path=parent.subsections | first) %}
{% if index == first_subsection %}
{% if parent.pages %}
{% set last_page = parent.pages | last %}
<ahref="{{ last_page.permalink }}"><divclass="card my-1"><divclass="card-body py-2">
← {{ last_page.title }}
</div></div></a>
{% endif %}
...
{% endmacro %}
I read the theme source for this but it was still a bit abstract. It would be nice to have this documented in the top-level docs in a way that shows what the theme designer intended.
The text was updated successfully, but these errors were encountered: