summaryrefslogtreecommitdiff
path: root/layouts/_partials/posts/toc.html
blob: 0bc96782e5439a0a1e73d69e0ade5bb0c4223493 (plain)
1
2
3
4
5
6
7
8
9
10
{{ $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 }} 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>
</div>
{{ end }}