diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2023-02-25 13:15:44 +0100 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2023-02-25 13:15:44 +0100 |
| commit | 900bb5e845c3ad44defbd427cae3d44a4a43321f (patch) | |
| tree | df3d96a93771884add571e82336c29fc3d9c7a1c /code/frontpage/layouts/partials/sidebar/auto-default-menu.html | |
| download | greatoffice-900bb5e845c3ad44defbd427cae3d44a4a43321f.tar.xz greatoffice-900bb5e845c3ad44defbd427cae3d44a4a43321f.zip | |
feat: Initial commit
Diffstat (limited to 'code/frontpage/layouts/partials/sidebar/auto-default-menu.html')
| -rw-r--r-- | code/frontpage/layouts/partials/sidebar/auto-default-menu.html | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/code/frontpage/layouts/partials/sidebar/auto-default-menu.html b/code/frontpage/layouts/partials/sidebar/auto-default-menu.html new file mode 100644 index 0000000..6e4565b --- /dev/null +++ b/code/frontpage/layouts/partials/sidebar/auto-default-menu.html @@ -0,0 +1,37 @@ +<!-- Auto default section menu --> +{{ $currentPage := . -}} +{{ $section := $currentPage.Section -}} +{{ range (where .Site.Sections "Section" "in" $section) }} + {{ range .Sections }} + {{ $active := in $currentPage.RelPermalink .RelPermalink }} + <h3 class="h6 text-uppercase mb-2">{{ .Title }}</h3> + <ul class="list-unstyled"> + {{ range .Pages }} + {{ if .IsNode }} + {{ $active := in $currentPage.RelPermalink .RelPermalink }} + <h4 class="h6 text-uppercase ms-3 mt-3 mb-2">{{ .Title }}</h4> + <ul class="list-unstyled ms-3"> + {{ range .Pages }} + {{ if .IsNode }} + {{ $active := in $currentPage.RelPermalink .RelPermalink }} + <h5 class="h6 text-uppercase mt-2 mb-2">{{ .Title }}</h5> + <ul class="list-unstyled ms-3"> + {{ range .Pages }} + {{ $active := in $currentPage.RelPermalink .RelPermalink }} + <li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .Permalink }}">{{ .Name }}</a></li> + {{ end }} + </ul> + {{ else }} + {{ $active := in $currentPage.RelPermalink .RelPermalink }} + <li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .Permalink }}">{{ .Name }}</a></li> + {{ end }} + {{ end }} + </ul> + {{ else }} + {{ $active := in $currentPage.RelPermalink .RelPermalink }} + <li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .Permalink }}">{{ .Name }}</a></li> + {{ end }} + {{ end }} + </ul> + {{ end }} +{{ end }} |
