feat: 将目录(TOC)移至侧边栏并优化滚动高亮逻辑

- 重构TOC组件,移至SideBar中显示
- 改进IntersectionObserver实现,优化章节高亮行为
- 添加toc国际化翻译(中/英/繁)
- 更新Swup容器配置,支持文章页侧边栏刷新
- 移除原MainGridLayout中的独立TOC容器
This commit is contained in:
2026-03-22 12:16:51 +08:00
parent b7ebf3bef7
commit cbf35beeb8
9 changed files with 261 additions and 257 deletions
+1
View File
@@ -37,6 +37,7 @@ enum I18nKey {
notFoundDesc = "notFoundDesc",
backToHome = "backToHome",
pinned = "pinned",
toc = "toc",
}
export default I18nKey;
+1
View File
@@ -40,4 +40,5 @@ export const en: Translation = {
[Key.notFoundDesc]: "The link is broken, the page has gone missing",
[Key.backToHome]: "Back to Home",
[Key.pinned]: "Pinned",
[Key.toc]: "Toc",
};
+1
View File
@@ -40,4 +40,5 @@ export const zh_CN: Translation = {
[Key.notFoundDesc]: "你访问的链接已断开,页面走丢了",
[Key.backToHome]: "返回首页",
[Key.pinned]: "置顶",
[Key.toc]: "目录",
};
+1
View File
@@ -40,4 +40,5 @@ export const zh_TW: Translation = {
[Key.notFoundDesc]: "你訪問的連結已斷開,頁面走丟了",
[Key.backToHome]: "返回首頁",
[Key.pinned]: "置頂",
[Key.toc]: "目錄",
};