{{/* Table of Contents */}} {{/* TODO: toc bottom part should be able to hide */}} {{- $toc := .Params.toc | default true -}} {{- $onThisPage := (T "onThisPage") | default "On this page"}} {{- $editThisPage := (T "editThisPage") | default "Edit this page"}} {{- $backToTop := (T "backToTop") | default "Scroll to top" -}} {{/* 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) "hx-font-semibold" (printf "ltr:hx-pl-%d rtl:hx-pr-%d" $padding $padding) -}} {{- range $headings }} {{- if .Title }}
  • {{- .Title | safeHTML | plainify | htmlUnescape }}
  • {{- end -}} {{- with .Headings -}} {{ template "toc-subheading" (dict "headings" . "level" (add $level 1)) }} {{- end -}} {{- end -}} {{- end -}}