diff options
| author | Eltrac <hi@guhub.cn> | 2025-08-26 10:28:00 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-08-26 10:28:00 +0800 |
| commit | 6fc8a8a1e563bea6c9efcc19f2424f45009a71de (patch) | |
| tree | 3426f897eac1628bc3b5ef78eb4649c6561f7128 /layouts/library/page.html | |
| parent | 52345965347199d43452168fd4462e06e0dbdaf1 (diff) | |
feat: add toc to library and normal pages
Former-commit-id: e7f41626f0e3d8019562ef2d7a3d99e05e0b1e55
Diffstat (limited to 'layouts/library/page.html')
| -rw-r--r-- | layouts/library/page.html | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/layouts/library/page.html b/layouts/library/page.html index e8760b60..1e9753a5 100644 --- a/layouts/library/page.html +++ b/layouts/library/page.html @@ -27,8 +27,9 @@ </p> </header> - <div class="markdown-body"> - <div class="leading-loose">{{ .Content }}</div> + <div class="markdown-body leading-loose"> + {{ partial "posts/toc" . }} + <div>{{ .Content }}</div> {{ partial "posts/endnotes" . }} </div> @@ -43,7 +44,7 @@ {{ $books := where (where .Site.RegularPages "Section" "library") ".Params.author" "==" .Params.author }} {{ $thisBookID := .File.UniqueID }} - {{ if gt (count $books) 1 }} + {{ if gt (len $books) 1 }} <h2>我读过的{{ .Params.author }}的其它书籍</h2> <div class="grid grid-cols-4 md:grid-cols-6 items-center gap-4 my-4"> {{ range $books }} |
