GitHub

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}}>{{label}}</a>
            {{else}}
            <span{{#if title}} title="{{title}}"{{/if}}>{{label}}</span>
            {{/if}}

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

Subscribe

Get the latest Publii news, updates and more delivered directly to your email inbox

You can change your mind at any time by clicking the unsubscribe link in the footer of any email you receive from us, or by contacting us at contact@tidycustoms.net. By clicking below, you agree that we may process your information in accordance with our Privacy Policy.