{{/* Render the top-nav in sidebar for small screens */}} {{ define "renderChildren" }} {{- range .Pages }} {{- if eq .Params.sitemap false }} {{- continue }} {{- end }} {{- if .IsSection }} {{- template "renderList" . }} {{- else }} {{- template "renderSingle" . }} {{- end }} {{- end }} {{ end }} {{/* Recursive template for sidebar items */}} {{ define "renderList" }} {{ $isCurrent := eq page . }} {{ $expanded := or $isCurrent (page.IsDescendant .) }}
  • {{- if .Permalink }} {{/* If the link is not empty, use it */}} {{ markdownify .LinkTitle }} {{- else }} {{/* Otherwise, just expand the section */}} {{- end }}
  • {{ end }} {{ define "renderSingle" }} {{ $isCurrent := eq page . }}
  • {{ markdownify .LinkTitle }}
  • {{ end }}