{{- $contentType := "all"}} {{- if eq (.Get "type") "section" }} {{- $contentType = "section" }} {{- end}} {{- $depthLimit := 2 }} {{- with .Get "depth" }} {{- $depthLimit = . }} {{- end }} {{- $startSection := .Page.Page }} {{- template "sectioncontent-loop" dict "startSection" $startSection "currentSection" $startSection "contentType" $contentType "depthLimit" $depthLimit "depthCnt" 0 }}
{{- define "sectioncontent-loop" }} {{- $startSection := .startSection }} {{- $currentSection := .currentSection }} {{- $contentType := .contentType }} {{- $depthLimit := .depthLimit }} {{- $depthCnt := add .depthCnt 1 }} {{- with .startSection }}
  • {{- with $currentSection }} {{- if and (ne $startSection $currentSection) (or (ne $contentType "section") .IsSection) }} {{- if .LinkTitle }} {{- .LinkTitle }} {{- else }} {{- replace .File.Dir .Parent.File.Dir "" | replaceRE "/" "-" | replaceRE "-$" ":" }} {{- .File.TranslationBaseName }} {{- end }} {{- end }} {{- end }} {{- if le $depthCnt $depthLimit }} {{- end }}
  • {{- end }} {{- end }}