From baabcb634bdffb8623eacc410e8707a3b4afe2b5 Mon Sep 17 00:00:00 2001 From: Emilio Ziniades Date: Sun, 12 May 2024 15:54:40 +0200 Subject: feat(table of contents): Add table of contents This feature is disabled by default, but can be enabled/disabled globally or per-page. Zola already provides `page.toc`, this PR simply adds a macro to recursively render that data in nested `ul`s. It also establishes some configuration options to display it and set a maximum headers level. --- config.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'config.toml') diff --git a/config.toml b/config.toml index fcb1d61..8927d04 100644 --- a/config.toml +++ b/config.toml @@ -45,12 +45,16 @@ highlight_code = true date_format="%Y-%m-%d" webserver_sends_csp_headers=true language_switcher=true - translations = [ { code="en", name="English" }, { code="de", name="Deutsch" }, ] +[extra.table_of_contents] +show=true +max_level=2 +visible_on_load=true + [[extra.main_menu]] name = "Home" name_de = "Startseite" -- cgit 1.4.1