initial commit
This commit is contained in:
commit
b710cfda80
98 changed files with 9669 additions and 0 deletions
42
layouts/partials/menu-bundle.html
Normal file
42
layouts/partials/menu-bundle.html
Normal file
|
@ -0,0 +1,42 @@
|
|||
{{ $current := .current }}
|
||||
{{ template "menu-file" dict "sect" .source "current" $current "site" $current.Site }}
|
||||
|
||||
{{ define "menu-file" }}
|
||||
{{ $current := .current }}
|
||||
{{ $site := .site }}
|
||||
|
||||
<ul class="gdoc-nav__list">
|
||||
{{ range sort (default (seq 0) .sect) "weight" "desc" }}
|
||||
{{ $current.Scratch.Set "current" $current }}
|
||||
{{ $current.Scratch.Set "site" $site }}
|
||||
|
||||
<li>
|
||||
{{ $ref := default false .ref }}
|
||||
{{ if $ref}}
|
||||
{{ $site := $current.Scratch.Get "site" }}
|
||||
{{ $this := $site.GetPage .ref }}
|
||||
{{ $current := $current.Scratch.Get "current" }}
|
||||
{{ $icon := default false .icon }}
|
||||
|
||||
<span class="flex">
|
||||
{{ if $icon }}<svg class="icon {{ .icon }}"><use xlink:href="#{{ .icon }}"></use></svg>{{ end }}
|
||||
<a href="{{ if .external }}{{ .ref }}{{ else }}{{ relref $current .ref }}{{ end }}"
|
||||
class="gdoc-nav__entry {{ if not .external }}{{ if eq $current $this }}is-active{{ end }}{{ end }}">
|
||||
{{ .name }}
|
||||
</a>
|
||||
</span>
|
||||
{{ else }}
|
||||
<span class="flex">
|
||||
{{ .name }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ $sub := default false .sub }}
|
||||
{{ if $sub }}
|
||||
{{ template "menu-file" dict "sect" $sub "current" ($current.Scratch.Get "current") "site" ($current.Scratch.Get "site") }}
|
||||
{{ end }}
|
||||
</li>
|
||||
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
Loading…
Add table
Add a link
Reference in a new issue