File tree 2 files changed +25
-3
lines changed
2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -32,3 +32,14 @@ blockquote {
32
32
max-height : 230px ; /* 最大高度,内容少时自动收缩 */
33
33
overflow-y : auto ;
34
34
}
35
+
36
+ /* 目录悬浮动效 */
37
+ .sticky-toc {
38
+ transition : transform 0.3s ease ;
39
+ }
40
+ /* 移动端隐藏目录 */
41
+ @media (max-width : 1024px ) {
42
+ .absolute.left-0 {
43
+ display : none ;
44
+ }
45
+ }
Original file line number Diff line number Diff line change @@ -44,10 +44,21 @@ <h1 class="h2 mb-4">
44
44
{{ time.Format ":date_long" .PublishDate }}
45
45
</li> -->
46
46
</ ul >
47
- < div class ="content mb-10 ">
48
- {{ partial "toc.html" (dict "Class" "blog" "Collapsed" false "TableOfContents" .TableOfContents ) }}
49
- {{ .Content }}
47
+
48
+ < div class ="relative ">
49
+ <!-- 独立 TOC 容器:固定在左侧 -->
50
+ < div class ="absolute left-0 top-0 h-full lg:w-3/12 md:w-4/12 pr-4 " style ="transform: translateX(-100%) ">
51
+ < div class ="sticky top-20 overflow-y-auto max-h-[80vh] pe-4 ">
52
+ {{ partial "toc.html" (dict "Class" "blog" "Collapsed" false "TableOfContents" .TableOfContents ) }}
53
+ </ div >
54
+ </ div >
55
+
56
+ <!-- 主内容区域 -->
57
+ < div class ="content ">
58
+ {{ .Content }}
59
+ </ div >
50
60
</ div >
61
+
51
62
< div class ="row items-start justify-between ">
52
63
{{ $tags:= .Params.tags }}
53
64
{{ if $tags }}
You can’t perform that action at this time.
0 commit comments