From 32d4a9358ce14c9dce687520e7c58cb93d07a7b6 Mon Sep 17 00:00:00 2001 From: welpo Date: Mon, 6 Feb 2023 16:01:46 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20set=20Table=20of=20Contents?= =?UTF-8?q?=20per=20page,=20not=20globally?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.toml | 1 - content/toc.md | 3 +++ templates/macros/macros.html | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config.toml b/config.toml index dd3b205..7b97c9e 100644 --- a/config.toml +++ b/config.toml @@ -15,7 +15,6 @@ highlight_code = true highlight_theme = "css" [extra] -toc = true use_cdn = false timeformat = "%d %B %Y" # Default format: "31 January 2049" diff --git a/content/toc.md b/content/toc.md index 5d73c27..8b2efd5 100644 --- a/content/toc.md +++ b/content/toc.md @@ -3,6 +3,9 @@ title = "Table of Contents Test" date = "2022-11-22" [taxonomies] tags = ["test"] + +[extra] +toc = true +++ # Heading 1 diff --git a/templates/macros/macros.html b/templates/macros/macros.html index 6d69a70..bc23a38 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -119,7 +119,7 @@ {% endif %} {# Optional table of contents #} - {% if config.extra.toc | default(value=false) %} + {% if page.extra.toc | default(value=false) %} {% if page.toc %}

Table of Contents