{{/* Table of Contents */}} {{/* TODO: toc bottom part should be able to hide */}} {{- $toc := .Params.toc | default true -}} {{/* TOC subheadings component. This is a recursive component that renders a list of headings. */}} {{- define "toc-subheading" -}} {{ $headings := .headings }} {{ $level := .level }} {{ if ge $level 6 }} {{ return }} {{ end }} {{ $padding := (mul $level 4) }} {{ $class := cond (eq $level 0) "font-semibold" (printf "ltr:pl-%d rtl:pr-%d" $padding $padding) }} {{ range $headings }} {{ if .Title }}
  • {{ .Title }}
  • {{ end }} {{ with .Headings }} {{ template "toc-subheading" (dict "headings" . "level" (add $level 1)) }} {{ end }} {{ end }} {{- end -}}