summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
Diffstat (limited to 'pages')
-rw-r--r--pages/pages.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/pages/pages.go b/pages/pages.go
index 8adb9e1..5ca5cff 100644
--- a/pages/pages.go
+++ b/pages/pages.go
@@ -48,7 +48,13 @@ func renderTemplate(config GlobalState, content markdown.Content) (string, error
return "", fmt.Errorf("failed to execute content template: %v", err)
}
- data.Body = string(html.MDToHTML(newContent.Bytes()))
+ hasToc := false
+ _, ok := content.Meta["toc"]
+ if ok {
+ hasToc = content.Meta["toc"].(bool)
+ }
+
+ data.Body = string(html.MDToHTML(newContent.Bytes(), hasToc))
b := &bytes.Buffer{}
if err := t.Execute(b, data); err != nil {