Back to Moodle

Docs Sidebar

public/admin/tool/componentlibrary/hugo/site/layouts/partials/docs-sidebar.html

5.2.01.3 KB
Original Source

{{$currentNode := .}} {{define "docs-sidebar"}} {{- $currentNode := .currentnode -}} {{ with .sect }} {{ if .IsSection }} {{ if in .Site.Params.menu_exclusion .Section }} {{- else -}} {{- safeHTML .Params.head -}} {{- $numberOfPages := (add (len .Pages) (len .Sections)) -}}

  • {{ safeHTML .Params.Pre }}{{ .Title }}{{ safeHTML .Params.Post }} {{ if ne $numberOfPages 0 }} {{- .Scratch.Set "pages" .Pages -}} {{- if .Sections -}} {{- .Scratch.Set "pages" (.Pages | union .Sections) -}} {{- end -}} {{- $pages := (.Scratch.Get "pages") -}} {{- if eq .Site.Params.ordersectionsby "title" -}} {{- range $pages.ByTitle -}} {{- if and .Params.hidden (not $.showhidden) -}} {{- else -}} {{template "docs-sidebar" dict "sect" . "currentnode" $currentNode}} {{- end -}} {{- end -}} {{- else -}} {{- range $pages.ByWeight -}} {{- if and .Params.hidden (not $.showhidden) -}} {{- else -}} {{template "docs-sidebar" dict "sect" . "currentnode" $currentNode}} {{- end -}} {{- end -}} {{- end}} {{end}} {{- end -}} {{- else -}} {{- if not .Params.Hidden -}}- {{ safeHTML .Params.Pre }}{{ .Title }}{{ safeHTML .Params.Post }} {{- end -}} {{ end -}} {{ end -}} {{ end }}