feat: Add menu to footer
This commit is contained in:
parent
be5badf317
commit
756a2ffbd9
@ -58,3 +58,11 @@
|
||||
#theme-toggle:focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
.footer nav a {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.footer nav a:hover {
|
||||
border-bottom: none;
|
||||
}
|
@ -1,5 +1,34 @@
|
||||
{{- if not (.Param "hideFooter") }}
|
||||
<footer class="footer">
|
||||
<nav class="nav">
|
||||
{{- $currentPage := . }}
|
||||
<ul id="menu">
|
||||
{{- range site.Menus.footer }}
|
||||
{{- $menu_item_url := (cond (strings.HasSuffix .URL "/") .URL (printf "%s/" .URL) ) | absLangURL }}
|
||||
{{- $page_url:= $currentPage.Permalink | absLangURL }}
|
||||
{{- $is_search := eq (site.GetPage .KeyName).Layout `search` }}
|
||||
<li>
|
||||
<a href="{{ .URL | absLangURL }}" title="{{ .Title | default .Name }} {{- cond $is_search (" (Alt + /)" | safeHTMLAttr) ("" | safeHTMLAttr ) }}"
|
||||
{{- cond $is_search (" accesskey=/" | safeHTMLAttr) ("" | safeHTMLAttr ) }}>
|
||||
<span {{- if eq $menu_item_url $page_url }} class="active" {{- end }}>
|
||||
{{- .Pre }}
|
||||
{{- .Name -}}
|
||||
{{ .Post -}}
|
||||
</span>
|
||||
{{- if (findRE "://" .URL) }}
|
||||
<svg fill="none" shape-rendering="geometricPrecision" stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2.5" viewBox="0 0 24 24" height="12" width="12">
|
||||
<path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"></path>
|
||||
<path d="M15 3h6v6"></path>
|
||||
<path d="M10 14L21 3"></path>
|
||||
</svg>
|
||||
{{- end }}
|
||||
</a>
|
||||
</li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
{{- if site.Copyright }}
|
||||
<span>{{ site.Copyright | markdownify }}</span>
|
||||
{{- else }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user