{{/* 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"}} {{/* 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 }}