diff --git a/README.md b/README.md index d9847cb5..8733dee2 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,7 @@ Optional page parameters: link: "https://youtu.be/dQw4w9WgXcQ" # The reference for an anchor around the title math: true # Enable math typesetting with KaTeX paige_hide_search: true # Don't include this page in search results +paige_toc: true # Show a table of contents if there are any headers ``` Additional optional home page parameters: diff --git a/layouts/partials/paige-content.html b/layouts/partials/paige-content.html index 3fb32b39..43626dd3 100644 --- a/layouts/partials/paige-content.html +++ b/layouts/partials/paige-content.html @@ -1,3 +1,14 @@ -{{ with .Content }} -{{ . | replaceRE `()` `${1}${3}` | safeHTML }} +{{ if .Content }} +{{ if and .Params.paige_toc (ne .TableOfContents ``) }} +
+
+
+
+ {{ .TableOfContents }} +
+
+
+
+{{ end }} +{{ .Content | replaceRE `()` `${1}${3}` | safeHTML }} {{ end }}