@@ -2,16 +2,13 @@ import {blogSource} from "@/lib/source";
22import Link from "next/link" ;
33import { notFound } from "next/navigation" ;
44import { metadataImage } from "@/lib/metadata" ;
5- import { Button } from "@/components/ui/button" ;
6- import { ArrowLeft } from "lucide-react" ;
75import { calculateReadingTime } from "@/lib/timeToRead" ;
8- import Image from "next/image" ;
96import defaultMdxComponents from "fumadocs-ui/mdx" ;
107import CustomToc from "@/components/blog/CustomToc" ;
118import BlogCard from "@/components/blog/BlogCard" ;
129import { getCategoryColor } from "@/lib/categoryColor" ;
1310import Subscribe from "@/components/blog/Subscribe" ;
14- import ShareDropdown from "@/components/blog/ShareDropdown " ;
11+ import SignUp from "@/components/blog/SignUp " ;
1512
1613export async function generateMetadata ( props : {
1714 params : Promise < { slug ?: string } > ;
@@ -50,61 +47,52 @@ export default async function page(props: {
5047 } ) . slice ( 0 , 2 ) ;
5148
5249 return (
53- < >
54- < div className = "container pt-[40px] lg:px-10 pb-10" >
55- < div className = "flex justify-between items-center" >
56- < Link className = "text-sm font-normal" href = "/blog" >
57- < Button className = "cursor-pointer hover:underline underline-red" variant = "none" >
58- < div className = "flex text-nc-content-grey-subtle items-center gap-2" >
59- < ArrowLeft />
60- Back
61- </ div >
62- </ Button >
63- </ Link >
64- < ShareDropdown
65- url = { `https://nocodb.com/blog/${ params . slug } ` }
66- title = { page . data . title }
67- />
68- </ div >
69- < div className = "my-8 flex flex-col gap-3" >
70- < div
71- className = "text-nc-content-grey-emphasis text-2xl lg:text-[40px] font-bold leading-9 lg:leading-[64px]" >
72- { page . data ?. title }
50+ < div className = "relative w-full bg-gradient-to-b from-blue-50/50 via-purple-50/30 via-30% to-white to-60%" >
51+ { /* Decorative background elements */ }
52+ < div className = "absolute top-0 right-0 w-[500px] h-[500px] bg-blue-400/10 rounded-full blur-3xl -z-10" />
53+ < div className = "absolute top-[40%] left-0 w-[400px] h-[400px] bg-purple-400/10 rounded-full blur-3xl -z-10" />
54+
55+ { /* Hero Section */ }
56+ < div className = "container py-4 lg:py-12" >
57+ { /* Category Badge */ }
58+ < Link className = "inline-block mb-6" href = { `/blog?category=${ page . data ?. category } ` } >
59+ < div
60+ style = { { backgroundColor : getCategoryColor ( page ?. data ?. category ) } }
61+ className = "rounded-lg px-3 py-1.5 text-sm font-medium text-nc-content-grey-default hover:opacity-80 transition-opacity"
62+ >
63+ { page . data ?. category }
7364 </ div >
74- < Link className = "w-[fit-content]" href = { `/blog?category=${ page . data ?. category } ` } >
75- < div style = { { backgroundColor : getCategoryColor ( page ?. data ?. category ) } }
76- className = "rounded-[6px] px-2 text-nc-content-grey-default" >
77- { page . data ?. category }
65+ </ Link >
66+
67+ { /* Title */ }
68+ < h1 className = "text-nc-content-grey-emphasis text-3xl lg:text-5xl font-bold leading-tight lg:leading-tight mb-6 max-w-4xl" >
69+ { page . data ?. title }
70+ </ h1 >
71+
72+ { /* Metadata */ }
73+ < div className = "flex flex-wrap items-center gap-4 text-nc-content-grey-subtle-2" >
74+ < div className = "flex items-center gap-2" >
75+ < div className = "w-10 h-10 rounded-full bg-nc-background-grey-light flex items-center justify-center text-nc-content-grey-emphasis font-semibold" >
76+ { page ?. data ?. author ?. charAt ( 0 ) . toUpperCase ( ) }
7877 </ div >
79- </ Link >
80- </ div >
81- < div className = "flex justify-center items-center leading-6 text-nc-content-grey-subtle-2" >
82- < div className = "flex-1" >
83- < span className = "mr-3" >
84- { page ?. data ?. author }
85- </ span >
86- |
87- < span className = "mx-3" >
88- { new Date ( page . data . date ) . toLocaleDateString ( "en-US" , { } ) }
89- </ span >
90- </ div >
91-
92- < div >
93- { calculateReadingTime ( page ?. data ?. structuredData ) }
78+ < span className = "font-medium" > { page ?. data ?. author } </ span >
9479 </ div >
80+ < span className = "text-nc-content-grey-muted" > •</ span >
81+ < span > { new Date ( page . data . date ) . toLocaleDateString ( "en-US" , {
82+ month : "long" ,
83+ day : "numeric" ,
84+ year : "numeric"
85+ } ) } </ span >
86+ < span className = "text-nc-content-grey-muted" > •</ span >
87+ < span > { calculateReadingTime ( page ?. data ?. structuredData ) } </ span >
9588 </ div >
9689 </ div >
9790
98- < div className = "container mx-auto" >
99- < div className = "relative w-full aspect-video" >
100- < Image className = "w-full object-cover" src = { page . data . image } alt = { page . data . title } fill />
101- </ div >
102- </ div >
103-
104- < article className = "container py-10 mx-auto" >
91+ < article className = "container py-10 lg:py-16 mx-auto" >
10592 < div className = "flex nc-blog-layout relative gap-8" >
106- < div className = "sticky hidden lg:block h-48 top -8" >
93+ < div className = "sticky hidden lg:block top-8 self-start space-y -8" >
10794 < CustomToc toc = { page . data . toc } />
95+ < SignUp />
10896 </ div >
10997 < div className = "prose min-w-0 flex-1" >
11098 < page . data . body components = { defaultMdxComponents } />
@@ -115,19 +103,20 @@ export default async function page(props: {
115103
116104 {
117105 related ?. length === 2 ? (
118- < div className = "container mx-auto" >
119- < h1 className = "text-nc-content-grey-emphasis leading-[62px] font-bold text-[40px]" >
120- Related
121- </ h1 >
122- < div className = "pt-15 gap-8 lg:gap-10 grid grid-cols-1 lg:grid-cols-2 pb-20" >
123- { related . map ( ( post ) => (
124- < BlogCard post = { post } key = { post . url } />
125- ) ) }
106+ < div className = "bg-nc-background-grey-extra-light/30 py-16" >
107+ < div className = "container mx-auto" >
108+ < h2 className = "text-nc-content-grey-emphasis text-3xl lg:text-4xl font-bold mb-8" >
109+ Related Articles
110+ </ h2 >
111+ < div className = "flex flex-col gap-0" >
112+ { related . map ( ( post ) => (
113+ < BlogCard post = { post } key = { post . url } />
114+ ) ) }
115+ </ div >
126116 </ div >
127117 </ div >
128118 ) : ( < div className = "py-10" > </ div > )
129119 }
130-
131- </ >
120+ </ div >
132121 ) ;
133122}
0 commit comments