2021-01-24 22:04:52 +00:00
|
|
|
{{ $current := .current }}
|
|
|
|
{{ template "menu-file" dict "sect" .source "current" $current "site" $current.Site "target" .target }}
|
|
|
|
|
2021-12-30 14:55:55 +00:00
|
|
|
|
2021-01-24 22:04:52 +00:00
|
|
|
<!-- template -->
|
|
|
|
{{ define "menu-file" }}
|
2021-12-30 14:55:55 +00:00
|
|
|
{{ $current := .current }}
|
|
|
|
{{ $site := .site }}
|
|
|
|
{{ $target := .target }}
|
2021-01-24 22:04:52 +00:00
|
|
|
|
2021-12-30 14:55:55 +00:00
|
|
|
{{ range sort (default (seq 0) .sect) "weight" }}
|
2021-01-24 22:04:52 +00:00
|
|
|
{{ if isset . "ref" }}
|
2021-12-30 14:55:55 +00:00
|
|
|
{{ $this := $site.GetPage .ref }}
|
|
|
|
{{ $isCurrent := eq $current $this }}
|
|
|
|
{{ $icon := default false .icon }}
|
2021-01-24 22:04:52 +00:00
|
|
|
|
2021-12-30 14:55:55 +00:00
|
|
|
{{ if eq $target "footer" }}
|
2021-11-23 20:40:58 +00:00
|
|
|
<span class="gblog-footer__item gblog-footer__item--row">
|
2021-12-30 14:55:55 +00:00
|
|
|
{{ if $icon }}
|
2022-04-30 11:36:39 +00:00
|
|
|
<svg class="gblog-icon {{ .icon }}"><use xlink:href="#{{ .icon }}"></use></svg>
|
2021-12-30 14:55:55 +00:00
|
|
|
{{ end }}
|
|
|
|
<a
|
2022-02-06 15:59:16 +00:00
|
|
|
href="{{ if .external -}}
|
2021-12-30 14:55:55 +00:00
|
|
|
{{ .ref }}
|
2022-02-06 15:59:16 +00:00
|
|
|
{{- else -}}
|
2021-12-30 14:55:55 +00:00
|
|
|
{{ relref $current .ref }}
|
2022-02-06 15:59:16 +00:00
|
|
|
{{- end }}"
|
2021-12-30 14:55:55 +00:00
|
|
|
class="gblog-footer__link"
|
|
|
|
>
|
|
|
|
{{ .name }}
|
|
|
|
</a>
|
2021-01-24 22:04:52 +00:00
|
|
|
</span>
|
2021-12-30 14:55:55 +00:00
|
|
|
{{ else if eq $target "header" }}
|
2021-01-24 22:04:52 +00:00
|
|
|
<li>
|
2021-12-30 14:55:55 +00:00
|
|
|
<a
|
2022-02-06 15:59:16 +00:00
|
|
|
href="{{ if .external -}}
|
2021-12-30 14:55:55 +00:00
|
|
|
{{ .ref }}
|
2022-02-06 15:59:16 +00:00
|
|
|
{{- else -}}
|
2021-12-30 14:55:55 +00:00
|
|
|
{{ relref $current .ref }}
|
2022-02-06 15:59:16 +00:00
|
|
|
{{- end }}"
|
|
|
|
class="gblog-nav__entry{{ if $isCurrent }}{{ printf " %s" "is-active" }}{{ end }}"
|
2021-12-30 14:55:55 +00:00
|
|
|
>
|
2022-02-07 08:01:52 +00:00
|
|
|
<span class="flex align-center">
|
|
|
|
{{ if $icon }}
|
2022-04-30 11:36:39 +00:00
|
|
|
<svg class="gblog-icon {{ .icon }}"><use xlink:href="#{{ .icon }}"></use></svg>
|
2022-02-07 08:01:52 +00:00
|
|
|
{{ end }}
|
|
|
|
<span>
|
|
|
|
{{ .name }}
|
|
|
|
</span>
|
|
|
|
</span>
|
2021-12-30 14:55:55 +00:00
|
|
|
</a>
|
2021-01-24 22:04:52 +00:00
|
|
|
</li>
|
2021-12-30 14:55:55 +00:00
|
|
|
{{ end }}
|
2021-01-24 22:04:52 +00:00
|
|
|
{{ end }}
|
2021-12-30 14:55:55 +00:00
|
|
|
{{ end }}
|
2021-01-24 22:04:52 +00:00
|
|
|
{{ end }}
|