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