From a287d11246cc0c18a9bf4435bddffc9e163e64fd Mon Sep 17 00:00:00 2001 From: meleu Date: Sun, 3 Apr 2022 22:12:55 -0300 Subject: [PATCH 1/2] add a collapsible ToC --- assets/styles/base.scss | 17 +++++++++++++++++ data/config.yaml | 1 + layouts/_default/single.html | 6 ++++-- layouts/index.html | 6 ++++-- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/assets/styles/base.scss b/assets/styles/base.scss index aa172d0c3..38c1f53e1 100644 --- a/assets/styles/base.scss +++ b/assets/styles/base.scss @@ -23,6 +23,23 @@ p, ul, text { padding: revert; } +.mainTOC { + background: var(--lightgray); + border-radius: 8px; + padding: 0.8em; +} + +.mainTOC details summary { + cursor: zoom-in; + font-family: Inter; + color: var(--dark); + font-weight: 700; +} + +.mainTOC details[open] summary { + cursor: zoom-out; +} + #TableOfContents > ol { counter-reset: section; margin-left: 0em; diff --git a/data/config.yaml b/data/config.yaml index c59c0e082..e33c32939 100644 --- a/data/config.yaml +++ b/data/config.yaml @@ -1,5 +1,6 @@ name: Jacky Zhao enableToc: true +openToc: false enableLinkPreview: true enableLatex: true description: diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 3423a0c58..02965f91c 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -24,8 +24,10 @@ {{ if (and $.Site.Data.config.enableToc (ne .Params.enableToc false)) }} {{end}} {{partial "textprocessing.html" . }} diff --git a/layouts/index.html b/layouts/index.html index 6fb75f9d9..466a05a39 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -15,8 +15,10 @@
{{ if (and $.Site.Data.config.enableToc (ne .Params.enableToc false)) }} {{end}} {{partial "textprocessing.html" . }} From 671fe05312ded0e96ba16140290a375c51c975ba Mon Sep 17 00:00:00 2001 From: meleu Date: Mon, 4 Apr 2022 17:07:43 -0300 Subject: [PATCH 2/2] padding and border-radius matching bottom cards Co-authored-by: Jacky Zhao --- assets/styles/base.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/styles/base.scss b/assets/styles/base.scss index 38c1f53e1..b26dbd678 100644 --- a/assets/styles/base.scss +++ b/assets/styles/base.scss @@ -25,8 +25,8 @@ p, ul, text { .mainTOC { background: var(--lightgray); - border-radius: 8px; - padding: 0.8em; + border-radius: 5px; + padding: 0.75em 1em; } .mainTOC details summary {