community.dhcf.eu Sign in

nav.conf

Define site navigation as a plain text file.

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.

Location

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.

Syntax

Label | /url
Parent Label
  Child Label | /child-url
  Another Child | /another

TT variable structure

Each nav item is a hash with:

Example

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 %]

Notes