Download

menu.hbs partial

The menu partial is used for rendering menus at your website.
This partial should get a param with a structure of the menu to render:

{{> menu menus.mainMenu}}

Above code will render the main menu of the website.

You have not include partials/menu.hbs in your theme. In this case Publii will load the following default menu.hbs file:

{{#unless level}}
<nav>
{{/unless}}
    <ul{{#if level}} class="submenu submenu-level-{{level}}"{{else}} class="menu menu-level-1"{{/if}}>
        {{#each items}}
            <li{{menuItemClasses}}>
            {{#if link}}
            <a href="{{menuUrl}}"{{#if title}} title="{{title}}"{{/if}}{{#if target}} target="{{target}}"{{/if}}{{#if rel}} rel="{{rel}}"{{/if}}>{{label}}</a>
            {{else}}
            <span{{#if title}} title="{{title}}"{{/if}}>{{label}}</span>
            {{/if}}

            {{#if items}}
                {{> menu}}
            {{/if}}
        </li>
        {{/each}}
    </ul>
{{#unless level}}
</nav>
{{/unless}}

Menu positions are defined in the menus section of config.json, and the default partial uses the menuUrl and menuItemClasses helpers.

What are you waiting for?

Start building your site today.

  1. 1 Download Publii
  2. 2 Write your content
  3. 3 Publish your site
Create website