mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 08:29:01 +00:00
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? push client directive to leaf interactive components, keep content in server shell ## What is the current behavior? /pricing and blog pages are rendered it client side so crawlers don't get any content on fetch. Verifiy content with ```bash curl -s http://localhost:3000/pricing | sed 's/<script[^>]*>.*<\/script>//g; s/<style[^>]*>.*<\/style>//g; s/<[^>]*>//g' | wc -w curl -s http://localhost:3000/blog | sed 's/<script[^>]*>.*<\/script>//g; s/<style[^>]*>.*<\/style>//g; s/<[^>]*>//g' | wc -w curl -s http://localhost:3000/blog/<some-slug> | sed 's/<script[^>]*>.*<\/script>//g; s/<style[^>]*>.*<\/style>//g; s/<[^>]*>//g' | wc -w ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Featured blog post now displays prominently on the blog landing page * Added smooth anchor link navigation on the pricing page * Improved table of contents tracking with scroll-to-anchor behavior on blog posts * Enhanced pricing comparison and plans sections with better data integration <!-- end of auto-generated comment: release notes by coderabbit.ai -->
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import BlogPostAnchorEffect from './BlogPostAnchorEffect'
|
|
import BlogPostRenderer from '@/components/Blog/BlogPostRenderer'
|
|
import authors from '@/lib/authors.json'
|
|
import { isNotNullOrUndefined } from '@/lib/helpers'
|
|
import type { Blog, BlogData, PostReturnType, ProcessedBlogData } from '@/types/post'
|
|
|
|
type BlogPostPageProps = {
|
|
prevPost: PostReturnType | null
|
|
nextPost: PostReturnType | null
|
|
relatedPosts: (PostReturnType & BlogData)[]
|
|
blog: Blog & BlogData
|
|
isDraftMode: boolean
|
|
}
|
|
|
|
export default function BlogPostClient(props: BlogPostPageProps) {
|
|
const blogMetaData = props.blog
|
|
|
|
const blogAuthors = (blogMetaData.author ?? '')
|
|
?.split(',')
|
|
.map((authorId) => authorId.trim())
|
|
.filter(Boolean)
|
|
.map((authorId) => {
|
|
const foundAuthor = authors.find((author) => author.author_id === authorId)
|
|
return foundAuthor ?? null
|
|
})
|
|
.filter(isNotNullOrUndefined)
|
|
|
|
return (
|
|
<>
|
|
<BlogPostAnchorEffect />
|
|
<BlogPostRenderer
|
|
blog={props.blog as ProcessedBlogData}
|
|
blogMetaData={blogMetaData as ProcessedBlogData}
|
|
isDraftMode={props.isDraftMode}
|
|
prevPost={props.prevPost}
|
|
nextPost={props.nextPost}
|
|
authors={blogAuthors}
|
|
/>
|
|
</>
|
|
)
|
|
}
|