summaryrefslogtreecommitdiff
path: root/layouts/_partials
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-08-26 10:28:00 +0800
committerEltrac <hi@guhub.cn>2025-08-26 10:28:00 +0800
commit6fc8a8a1e563bea6c9efcc19f2424f45009a71de (patch)
tree3426f897eac1628bc3b5ef78eb4649c6561f7128 /layouts/_partials
parent52345965347199d43452168fd4462e06e0dbdaf1 (diff)
feat: add toc to library and normal pages
Former-commit-id: e7f41626f0e3d8019562ef2d7a3d99e05e0b1e55
Diffstat (limited to 'layouts/_partials')
-rw-r--r--layouts/_partials/posts/toc.html3
1 files changed, 2 insertions, 1 deletions
diff --git a/layouts/_partials/posts/toc.html b/layouts/_partials/posts/toc.html
index ea87bb26..0bc96782 100644
--- a/layouts/_partials/posts/toc.html
+++ b/layouts/_partials/posts/toc.html
@@ -1,7 +1,8 @@
+{{ $top := cond (eq .Section "posts") "top-[19rem]" (cond (eq .Section "library") "top-[34rem]" "top-[17rem]") }}
{{ if .Params.toc }}
<div id="toc-container"
class="absolute bottom-0 left-[calc(50%_+_var(--page-width)_/_2)] right-auto
- h-full w-[calc(50%_-_var(--page-width)_/_2)] top-[19rem] hidden lg:block">
+ h-full w-[calc(50%_-_var(--page-width)_/_2)] {{ $top }} hidden lg:block">
<div id="toc"
class="sticky top-12 text-size-xs xl:text-size-sm 2xl:text-size-base w-full"
>{{ .TableOfContents }}</div>