diff --git a/components/mdx/H2.tsx b/components/mdx/H2.tsx index 49886a2..bdeaddf 100644 --- a/components/mdx/H2.tsx +++ b/components/mdx/H2.tsx @@ -2,7 +2,7 @@ import { fontFangZhengXiaoBiaoSongCN } from "@/styles/font"; export const H2 = (props: JSX.IntrinsicElements["h2"]) => { return ( -

+

{props.children}

); diff --git a/components/readerpage/TOC.tsx b/components/readerpage/TOC.tsx index f6c3d11..3092686 100644 --- a/components/readerpage/TOC.tsx +++ b/components/readerpage/TOC.tsx @@ -1,22 +1,27 @@ +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { TTOCItem } from "@/types/toc.type"; import Link from "next/link"; +import { Separator } from "../ui/separator"; export const TOC = (props: { data: TTOCItem[] }) => { return ( -
-
- {"TABLE OF CONTENTS"} -
- -
+ + + {"TABLE OF CONTENTS"} + + + +
    + {props.data?.map((item) => ( + +
  • {`${item.title}`}
  • + + ))} +
+
+
); }; diff --git a/components/ui/badge.tsx b/components/ui/badge.tsx new file mode 100644 index 0000000..d4d4fbf --- /dev/null +++ b/components/ui/badge.tsx @@ -0,0 +1,29 @@ +import { cva, type VariantProps } from "class-variance-authority"; +import * as React from "react"; + +import { cn } from "@/lib/utils"; + +const badgeVariants = cva( + "inline-flex items-center rounded-full border px-2.5 py-1 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", + { + variants: { + variant: { + default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80", + secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", + destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80", + outline: "text-foreground", + }, + }, + defaultVariants: { + variant: "default", + }, + }, +); + +export interface BadgeProps extends React.HTMLAttributes, VariantProps {} + +function Badge({ className, variant, ...props }: BadgeProps) { + return
; +} + +export { Badge, badgeVariants }; diff --git a/components/ui/card.tsx b/components/ui/card.tsx new file mode 100644 index 0000000..afa13ec --- /dev/null +++ b/components/ui/card.tsx @@ -0,0 +1,79 @@ +import * as React from "react" + +import { cn } from "@/lib/utils" + +const Card = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +Card.displayName = "Card" + +const CardHeader = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +CardHeader.displayName = "CardHeader" + +const CardTitle = React.forwardRef< + HTMLParagraphElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +

+)) +CardTitle.displayName = "CardTitle" + +const CardDescription = React.forwardRef< + HTMLParagraphElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +

+)) +CardDescription.displayName = "CardDescription" + +const CardContent = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +

+)) +CardContent.displayName = "CardContent" + +const CardFooter = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +CardFooter.displayName = "CardFooter" + +export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } diff --git a/components/utils/NavBar.tsx b/components/utils/NavBar.tsx index a913b80..8b378ad 100644 --- a/components/utils/NavBar.tsx +++ b/components/utils/NavBar.tsx @@ -33,8 +33,8 @@ export const NavBar = () => { return ( setIsSideNavOpen(open)}> - +
{MenuItems.map((menuItem) => ( { return (
- {props.data.map((postListItem, index) => ( - + {props.data.map((postItem, index) => ( +
-
-

{postListItem.frontMatter.title}

- {postListItem.frontMatter.subtitle && ( +
+

{postItem.frontMatter.title}

+ {postItem.frontMatter.subtitle && (
- {postListItem.frontMatter.subtitle} + {postItem.frontMatter.subtitle}
)}
-
{normalizeDate(postListItem.frontMatter.time)}
- {postListItem.frontMatter.summary && ( -
-

{postListItem.frontMatter.summary}

+
{normalizeDate(postItem.frontMatter.time)}
+ {postItem.frontMatter.summary && ( +
+

{postItem.frontMatter.summary}

)} - {postListItem.frontMatter.tags && ( + {postItem.frontMatter.tags && (
- {postListItem.frontMatter.tags.map((tagName) => ( - + {postItem.frontMatter.tags.map((tagName) => ( + + {tagName} + ))}
)} diff --git a/pages/404.tsx b/pages/404.tsx index bd80e42..453d262 100644 --- a/pages/404.tsx +++ b/pages/404.tsx @@ -12,8 +12,8 @@ export default function NotFoundPage() { }; return ( + -

{"404 NOT FOUND"}

diff --git a/pages/about.tsx b/pages/about.tsx index e2eb300..3264696 100644 --- a/pages/about.tsx +++ b/pages/about.tsx @@ -16,8 +16,8 @@ export default function AboutPage() { description={"Type your brief self-introduction in a sentence here make SEO recognize it easily."} coverURL={Config.PageCovers.websiteCoverURL} /> + -

{"ABOUT ME"}

diff --git a/pages/blog/[id].tsx b/pages/blog/[id].tsx index 058efb6..cfffe2d 100644 --- a/pages/blog/[id].tsx +++ b/pages/blog/[id].tsx @@ -9,7 +9,6 @@ import { Toaster } from "@/components/ui/toaster"; import { Footer } from "@/components/utils/Footer"; import { NavBar } from "@/components/utils/NavBar"; import { SEO } from "@/components/utils/SEO"; -import { TagBadge } from "@/components/utils/TagBadge"; import { Config } from "@/data/config"; import { normalizeDate } from "@/lib/date"; import { getPostFileContent, sortedPosts } from "@/lib/post-process"; @@ -67,17 +66,17 @@ const ReaderPage = (props: ReaderPageProps) => { coverURL={props.frontMatter.coverURL ?? Config.AvatarURL} /> + - -
-
-
+
+
+
{props.frontMatter.coverURL && } -

{props.frontMatter?.title} -

+
{props.frontMatter?.subtitle && (
{ )} {props.frontMatter.tags && (
-
{"TAGS : "}
+
{"TAGS: "}
{props.frontMatter.tags.map((tagName) => ( - + + {tagName} + ))}
)} -
-
- {compiledSource && ( - - )} + +
+ {compiledSource && ( + + )} +

{
{isTOCLongEnough && ( -
+
)}
{isTOCLongEnough && ( -
+
)} diff --git a/pages/friends.tsx b/pages/friends.tsx index 5076115..83c97f5 100644 --- a/pages/friends.tsx +++ b/pages/friends.tsx @@ -13,8 +13,8 @@ export default function FriendsPage() { return ( + -

{"FRIENDS"}

diff --git a/pages/index.tsx b/pages/index.tsx index dfee306..9176af9 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -30,8 +30,8 @@ export default function Home(props: HomePageProps) { description={`Welcome to the ${Config.Nickname}'s blog website. It's the website for recording thoughts for technology, life experience and so on.`} coverURL={Config.PageCovers.websiteCoverURL} /> + - {props.pinnedPostList.length !== 0 && (
diff --git a/pages/posts/[[...slug]].tsx b/pages/posts/[[...slug]].tsx index c54596a..33ebbf5 100644 --- a/pages/posts/[[...slug]].tsx +++ b/pages/posts/[[...slug]].tsx @@ -6,7 +6,6 @@ import { Footer } from "@/components/utils/Footer"; import { NavBar } from "@/components/utils/NavBar"; import { PostList } from "@/components/utils/PostList"; import { SEO } from "@/components/utils/SEO"; -import { TagBadge } from "@/components/utils/TagBadge"; import { PostCountPerPagination } from "@/consts/consts"; import { Config } from "@/data/config"; import { sortedPosts } from "@/lib/post-process"; @@ -54,8 +53,8 @@ export default function PostsPage(props: PostsPageProps) { description={"Here is the list page for all published posts. Click here for more details."} coverURL={Config.PageCovers.websiteCoverURL} /> + -

{"ALL POSTS"} @@ -65,8 +64,12 @@ export default function PostsPage(props: PostsPageProps) {
{props.tagList.map((item) => ( - - + + {`${item.name} (${item.count})`} ))}
diff --git a/pages/search.tsx b/pages/search.tsx index 0eeff8d..0795a7c 100644 --- a/pages/search.tsx +++ b/pages/search.tsx @@ -59,8 +59,8 @@ export default function SearchPage() { + -

{"SEARCH POSTS"}

@@ -72,7 +72,7 @@ export default function SearchPage() { onKeyDown={handleEnterKeySearch} onChange={handleInputSearchText} /> -

diff --git a/pages/sponsor.tsx b/pages/sponsor.tsx index d54ba4f..d07fa6b 100644 --- a/pages/sponsor.tsx +++ b/pages/sponsor.tsx @@ -21,8 +21,8 @@ export default function AboutPage() { "If you like my works, I would deeply appreciate your support as a patron. Your contribution not only fuels my creative journey but also allows me to delve deeper into my passion." } /> + -

+ -

diff --git a/styles/typesetting.css b/styles/typesetting.css index 789ce25..5051271 100644 --- a/styles/typesetting.css +++ b/styles/typesetting.css @@ -6,12 +6,7 @@ px-0 dark:prose-invert - prose-h1:text-2xl - prose-h2:scroll-mt-20 - prose-h3:scroll-mt-20 - prose-h4:scroll-mt-20 - prose-h5:scroll-mt-20 - prose-h6:scroll-mt-20 + prose-headings:scroll-mt-20 prose-a:text-sky-700 prose-figure:mx-auto