Files
supabase/apps/www/app/blog/[slug]/BlogPostClient.tsx
Alan Daniel 939b4034d9 /pricing and /blog invisible to LLMs — fix SSR bailout (#45292)
## 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 -->
2026-04-28 10:13:58 +03:00

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}
/>
</>
)
}