From e2f6f42c089bbea803abb0c57eeaa27c53f47f59 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 15 Aug 2021 13:46:47 -0700 Subject: CSS: support table of content If an entry has the parameter `#+toc` set to `t`, we will enable the table of content in the page. --- users/fcuny/notes/layouts/_default/single.html | 7 +++++++ users/fcuny/notes/static/css/custom.css | 12 ++++++++++++ 2 files changed, 19 insertions(+) (limited to 'users/fcuny') diff --git a/users/fcuny/notes/layouts/_default/single.html b/users/fcuny/notes/layouts/_default/single.html index 356f344..b4c5443 100644 --- a/users/fcuny/notes/layouts/_default/single.html +++ b/users/fcuny/notes/layouts/_default/single.html @@ -29,6 +29,13 @@ {{ end }} +{{ if .Params.toc }} +
+ Table of Contents + {{ .TableOfContents }} +
+{{ end }} + {{ .Content }} {{ end }} diff --git a/users/fcuny/notes/static/css/custom.css b/users/fcuny/notes/static/css/custom.css index b4e37bc..8f776d7 100644 --- a/users/fcuny/notes/static/css/custom.css +++ b/users/fcuny/notes/static/css/custom.css @@ -140,3 +140,15 @@ nav.menu a.menu-active:hover { nav.menu a.menu-active { color: #007d9c; } + +.toc { + border: 1px solid black; + padding: 1rem; + margin-top: 1rem; + color: black; +} + +.toc a, +.toc a.visited { + color: black; +} -- cgit 1.4.1