🐛 Fixed menu active action.
This commit is contained in:
parent
5630e240df
commit
44bf318330
@ -48,17 +48,17 @@ languages:
|
||||
main:
|
||||
- identifier: home
|
||||
name: Home
|
||||
url: /
|
||||
pageref: /
|
||||
pre: home
|
||||
weight: 1
|
||||
- identifier: about
|
||||
name: About
|
||||
url: /about.html
|
||||
pageref: /about.html
|
||||
pre: user
|
||||
weight: 2
|
||||
- identifier: archives
|
||||
name: Archives
|
||||
url: /posts
|
||||
pageref: /posts
|
||||
pre: archive
|
||||
weight: 3
|
||||
- identifier: commonweal
|
||||
@ -86,17 +86,17 @@ menus:
|
||||
main:
|
||||
- identifier: home
|
||||
name: 首页
|
||||
url: /
|
||||
pageref: /
|
||||
pre: home
|
||||
weight: 1
|
||||
- identifier: about
|
||||
name: 关于
|
||||
url: /about.html
|
||||
pageref: /about.html
|
||||
pre: user
|
||||
weight: 2
|
||||
- identifier: archives
|
||||
name: 归档
|
||||
url: /posts
|
||||
pageref: /posts
|
||||
pre: archive
|
||||
weight: 3
|
||||
- identifier: commonweal
|
||||
|
@ -2,13 +2,12 @@
|
||||
{{- $curP := .Page }}
|
||||
<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 "/")}}
|
||||
{{- 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 }}
|
||||
{{- if and $ms.badges (eq .Identifier "archives" ) }}
|
||||
{{- if and $ms.badges (eq .Identifier "archives") }}
|
||||
<span class="badge">{{ $.Scratch.Get "postsCount" }}</span>
|
||||
{{- end }}
|
||||
</a>
|
||||
|
@ -60,7 +60,6 @@
|
||||
{{- end }}
|
||||
</div>
|
||||
|
||||
{{- $lang := .Scratch.Get "lang" }}
|
||||
{{- with .Site.Params.creativeCommons }}
|
||||
{{- if .sidebar }}
|
||||
<div class="cc-license animated" itemprop="license">
|
||||
|
Loading…
Reference in New Issue
Block a user