hugo-geekdoc/layouts/shortcodes/toc.html

14 lines
425 B
HTML
Raw Permalink Normal View History

{{- $format := default "html" (.Get "format") }}
{{- $tocLevels := default (default 6 .Site.Params.geekdocToC) .Page.Params.geekdocToC }}
2020-01-12 14:33:02 +00:00
{{- if and $tocLevels .Page.TableOfContents -}}
{{- if not (eq ($format | lower) "raw") -}}
<div class="gdoc-toc gdoc-toc__level--{{ $tocLevels }}">
{{ .Page.TableOfContents }}
<hr />
</div>
{{- else -}}
{{ .Page.TableOfContents }}
{{- end -}}
{{- end -}}