From 5d37a104c4a413df04e4b0fbcfe6cb026cd52136 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 16 May 2025 15:03:14 +0800 Subject: perf: replace tocbot with statically generated toc Generate TOC with Hugo's built-in {{ .TableOfContents }} and add minimal script to implement collapsible list and active styles. Encapsulate TOC as a component where all JavaSript and CSS is in one place with HTML. Configure markup. Former-commit-id: 4b4629edb733d5ebd6485755fd2f63b0457f62c8 --- layouts/partials/components/toc.html | 130 +++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 layouts/partials/components/toc.html (limited to 'layouts/partials/components/toc.html') diff --git a/layouts/partials/components/toc.html b/layouts/partials/components/toc.html new file mode 100644 index 00000000..660d4bb2 --- /dev/null +++ b/layouts/partials/components/toc.html @@ -0,0 +1,130 @@ +
{{ .TableOfContents }}
+ + -- cgit v1.2.3