✨ Add site menus parameters.
This commit is contained in:
parent
0b53308c2d
commit
f879f77dab
@ -24,6 +24,35 @@ languages:
|
||||
subtitle: Theme for Hugo
|
||||
description: Stay easily & powerful.
|
||||
|
||||
#--------------------------------------
|
||||
# Menus Settings
|
||||
# Attribute pre is Font Awesome icon name without prefix "fa-".
|
||||
# External url should start with http:// or https:// .
|
||||
# -------------------------------------
|
||||
menus:
|
||||
main:
|
||||
- identifier: home
|
||||
name: 首页
|
||||
url: /
|
||||
pre: home
|
||||
weight: 1
|
||||
- identifier: about
|
||||
name: 关于
|
||||
url: /ablout.html
|
||||
pre: user
|
||||
weight: 2
|
||||
- identifier: archives
|
||||
name: 归档
|
||||
url: /archives
|
||||
pre: archive
|
||||
weight: 3
|
||||
- identifier: commonweal
|
||||
name: 公益 404
|
||||
url: /404.html
|
||||
pre: heartbeat
|
||||
weight: 4
|
||||
|
||||
|
||||
# -------------------------------------
|
||||
# User-define Settings
|
||||
# -------------------------------------
|
||||
@ -31,8 +60,6 @@ params:
|
||||
# -------------------------------------
|
||||
# Scheme Settings
|
||||
# -------------------------------------
|
||||
|
||||
# Schemes
|
||||
#scheme: Muse
|
||||
#scheme: Mist
|
||||
#scheme: Pisces
|
||||
@ -72,6 +99,9 @@ params:
|
||||
# admins: <fb:admin_id>
|
||||
# app_id: <fb:app_id>
|
||||
|
||||
#--------------------------------------
|
||||
# Sidebar Settings
|
||||
# -------------------------------------
|
||||
sidebar:
|
||||
# Sidebar Position.
|
||||
#position: left | right
|
||||
|
@ -1,23 +1,12 @@
|
||||
|
||||
<ul class="main-menu menu">
|
||||
<li class="menu-item menu-item-home">
|
||||
<a href="/" rel="section">
|
||||
<i class="fa fa-home fa-fw"></i>首页
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item menu-item-about">
|
||||
<a href="/about/" rel="section">
|
||||
<i class="fa fa-user fa-fw"></i>关于
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item menu-item-archives">
|
||||
<a href="/archives/" rel="section">
|
||||
<i class="fa fa-archive fa-fw"></i>归档
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item menu-item-commonweal">
|
||||
<a href="/404/" rel="section">
|
||||
<i class="fa fa-heartbeat fa-fw"></i>公益 404
|
||||
{{- $curP := . }}
|
||||
{{- range .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="hvr-icon-pulse{{if $active }} menu-item-active{{ end }}" rel="section">
|
||||
<i class="fa fa-{{ .Pre }} hvr-icon"></i>{{- .Name }}
|
||||
</a>
|
||||
</li>
|
||||
{{- end }}
|
||||
</ul>
|
Loading…
Reference in New Issue
Block a user