mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-26 05:19:01 +00:00
feat: hide TOC when no headers (closes #204)
This commit is contained in:
parent
2145e92b00
commit
cd7e2088d5
2 changed files with 4 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
---
|
---
|
||||||
title: 🪴 Quartz 3.3
|
title: 🪴 Quartz 3.
|
||||||
|
enableToc: false
|
||||||
---
|
---
|
||||||
|
|
||||||
Host your second brain and [digital garden](https://jzhao.xyz/posts/networked-thought) for free. Quartz features
|
Host your second brain and [digital garden](https://jzhao.xyz/posts/networked-thought) for free. Quartz features
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{{ if (and $.Site.Data.config.enableToc (ne .Params.enableToc false) (gt .WordCount 250)) }}
|
{{ $hasHeaders := gt (len (findRE "<h\\d.*?>(.|\n)*?</h\\d>" .Content)) 0 }}
|
||||||
|
{{ if (and $.Site.Data.config.enableToc (ne .Params.enableToc false) $hasHeaders) }}
|
||||||
<aside class="mainTOC">
|
<aside class="mainTOC">
|
||||||
<details {{ if $.Site.Data.config.openToc }}open {{ end }}>
|
<details {{ if $.Site.Data.config.openToc }}open {{ end }}>
|
||||||
<summary>{{ i18n "toc" }}</summary>
|
<summary>{{ i18n "toc" }}</summary>
|
||||||
|
|
Loading…
Reference in a new issue