From c06357a6041aae1a9ad7cdac5896d1fac43c7454 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Fri, 24 Jul 2020 22:03:13 +0530 Subject: [PATCH] add Table of Contents - can be used by `ShowToc = true` in Single Post params --- assets/css/main.css | 6 ++++++ layouts/_default/single.html | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/assets/css/main.css b/assets/css/main.css index 126b1bf9..b1874d7c 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -44,4 +44,10 @@ margin-left: auto; padding-left: 18px; padding-right: 16px; +} + +.toc { + border-bottom: 1px solid var(--border); + font-size: 20px; + font-weight: 500; } \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 2b9ecc7a..a2775fcb 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -12,6 +12,12 @@ {{- .Date.Format "January 2, 2006" -}} + {{ if .Params.ShowToc }} +
++ {{ end }}Table of Contents+ {{ .TableOfContents }} +