11import { createMetadata } from "@doc" ;
22import GithubSlugger from "github-slugger" ;
3- import { PlusIcon } from "lucide-react" ;
43import Link from "next/link" ;
54import ReactHtmlParser from "react-html-parser" ;
65import { Heading } from "@/components/Document" ;
7- import { Author } from "./components/Author" ;
8- import { ChangelogIndexTOC } from "./components/ChangeLogIndexTOC" ;
96import { RenderDate } from "./components/RenderData" ;
107import { fetchChangeLogs , fetchPost } from "./ghost" ;
118import { transform } from "./utils/transform" ;
@@ -23,12 +20,15 @@ export const metadata = createMetadata({
2320
2421export default async function Page ( ) {
2522 return (
26- < main className = "container" data-noindex >
27- < div className = "flex justify-between gap-16 " >
28- < div className = "w-full max-w-[850px] grow-0 " >
29- < PageContent / >
23+ < main data-noindex >
24+ < div className = "border-b py-12 border-dashed " >
25+ < div className = "container " >
26+ < h1 className = "font-semibold text-4xl tracking-tight" > Changelog </ h1 >
3027 </ div >
31- < ChangelogIndexTOC />
28+ </ div >
29+
30+ < div className = "container" >
31+ < PageContent />
3232 </ div >
3333 </ main >
3434 ) ;
@@ -39,53 +39,46 @@ async function PageContent() {
3939 const slugger = new GithubSlugger ( ) ;
4040
4141 return (
42- < div className = "changelog-page py-6" >
43- < h1 className = "mb-10 font-semibold text-3xl tracking-tighter" >
44- Changelog
45- </ h1 >
46-
47- < div className = "flex flex-col gap-10 xl:border-l-2 xl:pl-12" >
42+ < div className = "changelog-page overflow-hidden" >
43+ < div className = "flex flex-col gap-10 xl:border-l border-dashed xl:pl-16 max-w-4xl ml-auto pb-20" >
4844 { posts . map ( ( post ) => {
4945 return (
50- < div className = "relative pb-10" key = { post . id } >
51- < div className = "mb-2 flex items-center gap-5" >
52- { post . published_at && (
53- < RenderDate className = "text-base" iso = { post . published_at } />
54- ) }
55- < div className = "flex gap-5" >
56- { post . authors ?. map ( ( author ) => {
57- return (
58- < Author
59- key = { author . id }
60- name = { author . name || "" }
61- profileImage = { author . profile_image }
62- />
63- ) ;
64- } ) }
46+ < div className = "relative pt-10" key = { post . id } >
47+ < div className = "-left-16 -translate-x-full absolute top-12 hidden xl:flex gap-5 ml-3 items-center" >
48+ < div className = "hidden xl:block text-sm text-muted-foreground" >
49+ < RenderDate iso = { post . published_at } />
50+ </ div >
51+ < div className = "size-6 rounded-[50%] border bg-background flex items-center justify-center" >
52+ < div className = "size-2 bg-blue-500 rounded-full" />
6553 </ div >
66- </ div >
67-
68- < div className = "-left-12 -translate-x-1/2 absolute top-12 hidden size-7 items-center justify-center rounded-[50%] bg-foreground md:size-10 xl:flex" >
69- < PlusIcon className = "size-6 text-background" />
7054 </ div >
7155
7256 < div >
73- < Heading
74- anchorClassName = "[&>a]:hidden m-0 border-b pb-5 mb-5"
75- anchorId = { slugger . slug ( post . title || "" ) }
76- // eslint-disable-next-line tailwindcss/no-custom-classname
77- className = "changelog-title"
78- level = { 2 }
79- >
80- < Link
81- className = "!text-foreground font-bold text-3xl tracking-tighter hover:underline md:text-4xl xl:text-5xl"
82- href = { `/changelog/${ post . slug } ` }
83- >
84- { post . title }
85- </ Link >
86- </ Heading >
57+ { post . published_at && (
58+ < div className = "xl:hidden inline-flex rounded-full border px-3 py-2 mb-4 text-muted-foreground text-xs bg-card" >
59+ < RenderDate iso = { post . published_at } />
60+ </ div >
61+ ) }
8762
88- < RenderChangelogContent slug = { post . slug } />
63+ < div className = "space-y-3 mb-5" >
64+ < Heading
65+ anchorClassName = "[&>a]:hidden m-0"
66+ anchorId = { slugger . slug ( post . title || "" ) }
67+ // eslint-disable-next-line tailwindcss/no-custom-classname
68+ className = "changelog-title"
69+ level = { 2 }
70+ >
71+ < Link
72+ className = "!text-foreground font-semibold text-3xl md:text-4xl tracking-tight hover:underline !leading-tight"
73+ href = { `/changelog/${ post . slug } ` }
74+ >
75+ { post . title }
76+ </ Link >
77+ </ Heading >
78+ </ div >
79+ < div className = "text-muted-foreground" >
80+ < RenderChangelogContent slug = { post . slug } />
81+ </ div >
8982 </ div >
9083 </ div >
9184 ) ;
0 commit comments