-
排序:
+
+
+ 排序
-
diff --git a/components/post-storyline-nav.tsx b/components/post-storyline-nav.tsx
index 1ea9299..8ee9242 100644
--- a/components/post-storyline-nav.tsx
+++ b/components/post-storyline-nav.tsx
@@ -1,5 +1,7 @@
import Link from 'next/link';
import type { Post } from 'contentlayer/generated';
+import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { faArrowLeftLong, faArrowRightLong } from '@fortawesome/free-solid-svg-icons';
interface Props {
current: Post;
@@ -79,6 +81,10 @@ function Station({ station }: { station: StationConfig }) {
className={`group flex flex-col gap-1 text-center transition duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 dark:focus-visible:ring-blue-300 ${alignClass}`}
>
+
{label}
diff --git a/components/post-toc.tsx b/components/post-toc.tsx
index f369e2d..0483429 100644
--- a/components/post-toc.tsx
+++ b/components/post-toc.tsx
@@ -1,6 +1,8 @@
'use client';
import { useEffect, useState } from 'react';
+import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { faListUl, faCircle } from '@fortawesome/free-solid-svg-icons';
interface TocItem {
id: string;
@@ -48,11 +50,36 @@ export function PostToc() {
return () => observer.disconnect();
}, []);
+ const handleClick = (id: string) => (event: React.MouseEvent) => {
+ event.preventDefault();
+ const el = document.getElementById(id);
+ if (!el) return;
+
+ el.scrollIntoView({
+ behavior: 'smooth',
+ block: 'start'
+ });
+
+ // Temporary highlight
+ el.classList.add('toc-target-highlight');
+ setTimeout(() => {
+ el.classList.remove('toc-target-highlight');
+ }, 700);
+
+ // Update hash without instant jump
+ if (history.replaceState) {
+ const url = new URL(window.location.href);
+ url.hash = id;
+ history.replaceState(null, '', url.toString());
+ }
+ };
+
if (items.length === 0) return null;
return (