From aba7a3e3c6eb90093c054449810c829e208ab84a Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Mon, 11 Sep 2023 21:13:26 -0500 Subject: [PATCH] close #37: use the script https://github.com/yihui/misc.js/blob/main/js/toc-highlight.js to highlight TOC items when scrolling --- layouts/partials/foot_custom.html | 2 +- static/css/style.css | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/layouts/partials/foot_custom.html b/layouts/partials/foot_custom.html index 9910a62..6300f95 100644 --- a/layouts/partials/foot_custom.html +++ b/layouts/partials/foot_custom.html @@ -10,7 +10,7 @@ {{ template "_internal/google_analytics.html" . }} {{ if .IsPage }} - + {{ end }} {{ if and (not .Params.disable_highlight) (in (string .Content) "") }} diff --git a/static/css/style.css b/static/css/style.css index 26191dd..39e0f5a 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -168,6 +168,7 @@ blockquote { #TOC .numbered li { list-style: none; } #TOC .numbered { padding-left: 0; } #TOC .numbered ul { padding-left: 1em; } +#TOC .active { font-weight: bold; } .side-title { width: 3em; } .side-title h1 { border: none; } .post-card .side-title h1 a, .post-card .spacer-right, .appendix h3 { color: lightslategray; }