{{/* Table of Contents */}} {{/* TODO: toc should be able to get disabled through page frontmatter */}} {{/* TODO: toc bottom part should be able to hide */}}
{{ with .Fragments.Headings }}

On This Page

{{ range . }} {{ end }} {{ end }} {{ $borderClass := "mt-8 border-t bg-white pt-8 shadow-[0_-12px_16px_white] dark:bg-dark dark:shadow-[0_-12px_16px_#111]" }} {{ if not .Fragments.Headings }} {{ $borderClass = "" }} {{ end }}
{{/* TOC subheading component. This is a recursive component that renders a list of headings. */}} {{- define "side-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 "side-toc-subheading" (dict "headings" . "level" (add $level 1)) }} {{ end }} {{ end }} {{- end -}}