👷 Add sidebar menu items.
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
{{- $pluginVen := $P.vendors.plugins -}}
|
||||
{{- $pluginCDN := index $vendors $pluginVen -}}
|
||||
{{- .Scratch.Set "pluginCDN" $pluginCDN -}}
|
||||
{{ $posts := len .Site.RegularPages }}
|
||||
{{- .Scratch.Set "posts" $posts -}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ $lang }}">
|
||||
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
{{ partial "header/brand" . }}
|
||||
{{ partial "header/brand" . }}
|
||||
{{ partial "header/menus" . }}
|
||||
27
layouts/partials/header/menus.html
Normal file
27
layouts/partials/header/menus.html
Normal file
@@ -0,0 +1,27 @@
|
||||
{{- $ms := .P.menuSets }}
|
||||
{{- $curP := .Page }}
|
||||
{{- $post := .Scratch.Get "posts" }}
|
||||
<nav class="site-nav">
|
||||
<ul class="main-menu menu">
|
||||
{{- range $curP.Site.Menus.main }}
|
||||
{{- $active := or ($curP.IsMenuCurrent "main" .) ($curP.HasMenuCurrent "main" .) }}
|
||||
{{- $active = or $active (eq .URL "/")}}
|
||||
<li class="menu-item menu-item-{{ .Identifier }}">
|
||||
<a href="{{ .URL }}" class="{{if $active }} menu-item-active{{ end }}" rel="section">
|
||||
{{- if $ms.icons }}<i class="fa fa-{{ .Pre }}"></i>{{ end }}{{- .Name }}
|
||||
{{- if and $ms.badges (eq .Identifier "archives" ) }}
|
||||
<span class="badge">{{ $post }}</span>
|
||||
{{- end }}
|
||||
</a>
|
||||
</li>
|
||||
{{- end }}
|
||||
|
||||
{{- if or .P.algoliaSearch.enable .P.localSearch.enable }}
|
||||
<li class="menu-item menu-item-search">
|
||||
<a role="button" class="popup-trigger">
|
||||
{{- if $ms.icons }}<i class="fa fa-search fa-fw"></i>{{ end }}{{ T "MSearchLabel" }}
|
||||
</a>
|
||||
</li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
</nav>
|
||||
Reference in New Issue
Block a user