Summit of SummitsReturn to the Source
The navigation file defines a site navigation structure in plain text.
It is parsed into a TT array variable nav available in the view
template and page content.
public_html/lazysite/nav.conf
Override the path with nav_file: in lazysite.conf:
nav_file: lazysite/custom-nav.conf
The nav_file value is relative to the docroot.
Label | /url
Parent Label
Child Label | /child-url
Another Child | /another
Label | /url separated by a pipe character# are commentsEach nav item is a hash with:
label - the display texturl - the URL (empty string if no pipe)children - array of child items (each with label and url)Home | /
Docs
Getting Started | /docs/getting-started
Configuration | /docs/configuration
API Reference | /docs/api
Blog | /blog
About | /about
In the view template:
[% FOREACH item IN nav %]
<a href="[% item.url %]">[% item.label %]</a>
[% IF item.children.size %]
<ul>
[% FOREACH child IN item.children %]
<li><a href="[% child.url %]">[% child.label %]</a></li>
[% END %]
</ul>
[% END %]
[% END %]
nav is an empty arraynav in the
view template