liebling/partials/navigation.hbs

63 lines
2.1 KiB
Handlebars
Raw Permalink Normal View History

2019-04-14 18:41:25 +00:00
{{!--
This navigation template is shared across all the pages.
Also it includes the big submenu.
--}}
2019-02-19 23:00:22 +00:00
<ul role="menu">
{{#if @site.logo}}
<li class="only-desktop" role="menuitem">
<a href="{{@site.url}}" class="m-logo">
<img src="{{@site.logo}}" alt="{{@site.title}}">
</a>
</li>
{{/if}}
{{#foreach navigation}}
<li class="nav-{{slug}}{{#if current}} nav-current{{/if}}">
<a href="{{url absolute="true"}}">{{label}}</a>
</li>
{{/foreach}}
<li role="menuitem" class="js-submenu-option">
<button class="m-icon-button in-menu-main more js-toggle-submenu" aria-label="Toggle submenu">
<span class="icon-more"></span>
</button>
<div class="m-submenu js-submenu">
<div class="l-wrapper in-submenu">
<section class="m-recent-articles">
<h3 class="m-submenu-title in-recent-articles">Recent articles</h3>
<div class="js-recent-articles">
2019-02-20 12:13:59 +00:00
{{#get "posts" limit="4" order="published_at desc"}}
{{#foreach posts}}
2019-02-19 23:00:22 +00:00
<div>
<a href="{{url}}" class="m-recent-article">
<div class="m-recent-article__picture">
<div style="background-image: url({{img_url feature_image size="m"}});"></div>
</div>
<h3 class="m-recent-article__title">{{title}}</h3>
<span class="m-recent-article__date">{{date published_at timeago="true"}}</span>
</a>
</div>
2019-02-20 12:13:59 +00:00
{{else}}
<div class="m-no-found in-recent-articles">No recent articles found :(</div>
{{/foreach}}
2019-02-19 23:00:22 +00:00
{{/get}}
</div>
</section>
<section class="m-tags">
<h3 class="m-submenu-title">Tags</h3>
2019-02-20 12:13:59 +00:00
{{#get "tags" limit="10"}}
<ul>
{{#foreach tags}}
2019-02-19 23:00:22 +00:00
<li>
<a href="{{url}}">{{name}}</a>
</li>
2019-02-20 12:13:59 +00:00
{{else}}
<li class="m-no-found">No tags found :(</li>
{{/foreach}}
</ul>
{{/get}}
2019-02-19 23:00:22 +00:00
</section>
</div>
</div>
</li>
</ul>