hugo-theme-next/layouts/partials/header/menus.html

25 lines
978 B
HTML
Raw Normal View History

{{- $ms := .Site.Params.menuSets }}
{{- $curP := .Page }}
<nav class="site-nav">
<ul class="main-menu menu">
2022-06-24 19:12:08 +08:00
{{- range .Site.Menus.main }}
{{- $active := $curP.IsMenuCurrent "main" . }}
<li class="menu-item menu-item-{{ .Identifier }}">
<a href="{{ .URL | relLangURL }}" class="hvr-icon-pulse {{if $active }} menu-item-active{{ end }}" rel="section">
{{- if $ms.icons }}<i class="fa fa-{{ .Pre }} hvr-icon"></i>{{ end }}{{- .Name }}
2022-06-24 19:12:08 +08:00
{{- if and $ms.badges (eq .Identifier "archives") }}
<span class="badge">{{ $.Scratch.Get "postsCount" }}</span>
{{- end }}
</a>
</li>
{{- end }}
{{- if or .Site.Params.algoliaSearch.enable .Site.Params.localSearch.enable }}
<li class="menu-item menu-item-search">
<a role="button" class="popup-trigger hvr-icon-pulse">
{{- if $ms.icons }}<i class="fa fa-search fa-fw hvr-icon"></i>{{ end }}{{ T "MSearchLabel" }}
</a>
</li>
{{- end }}
</ul>
</nav>