mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 08:29:01 +00:00
## Problem Missing alt tag for the blog changelog feed, similar to part of #52292 ## Solution Adds it ## Preview links [blog homepage](https://zone-www-dot-com-git-kody-devrel-731-alternate-bef917-supabase.vercel.app/blog) <img width="1128" height="734" alt="image" src="https://github.com/user-attachments/assets/afc152d6-7041-4a27-9b08-3df9e8a85bcb" />
69 lines
2.4 KiB
TypeScript
69 lines
2.4 KiB
TypeScript
import type { Metadata } from 'next'
|
|
import { cookies } from 'next/headers'
|
|
|
|
import { BLOG_VIEW_COOKIE, isBlogView, type BlogView } from './blog-view'
|
|
import BlogClient from './BlogClient'
|
|
import SectionContainer from '@/components/Layouts/SectionContainer'
|
|
import { breadcrumbs } from '@/lib/breadcrumbs'
|
|
import { canonicalAlternates } from '@/lib/canonical'
|
|
import { breadcrumbListSchema, serializeJsonLd } from '@/lib/json-ld'
|
|
import { getSortedPosts } from '@/lib/posts'
|
|
|
|
export const metadata: Metadata = {
|
|
alternates: {
|
|
...canonicalAlternates('/blog'),
|
|
types: {
|
|
'application/rss+xml': [
|
|
{ url: 'https://supabase.com/rss.xml', title: 'RSS feed for the Supabase blog' },
|
|
],
|
|
},
|
|
},
|
|
title: 'Supabase Blog: the Postgres development platform',
|
|
description: 'Get all your Supabase News on the Supabase blog.',
|
|
openGraph: {
|
|
title: 'Supabase Blog: the Postgres development platform',
|
|
description: 'Get all your Supabase News on the Supabase blog.',
|
|
url: 'https://supabase.com/blog',
|
|
images: [{ url: 'https://supabase.com/images/og/supabase-og.png' }],
|
|
},
|
|
}
|
|
|
|
const INITIAL_POSTS_LIMIT = 25
|
|
|
|
export default async function BlogPage() {
|
|
const staticPostsData = getSortedPosts({ directory: '_blog', runner: '** BLOG PAGE **' })
|
|
|
|
const allPosts = [...staticPostsData].sort((a, b) => {
|
|
const dateA = new Date(a.date || a.formattedDate).getTime()
|
|
const dateB = new Date(b.date || b.formattedDate).getTime()
|
|
return dateB - dateA
|
|
})
|
|
|
|
// The featured post + secondary spotlights are derived from the head of this
|
|
// list inside BlogClient; chrome (nav, footer, container) comes from the blog
|
|
// route's layout.tsx.
|
|
const initialPosts = allPosts.slice(0, INITIAL_POSTS_LIMIT)
|
|
|
|
// Render the list/grid view from a cookie so it matches the user's choice on
|
|
// first paint (avoids the localStorage hydration flicker).
|
|
const cookieStore = await cookies()
|
|
const cookieView = cookieStore.get(BLOG_VIEW_COOKIE)?.value
|
|
const initialView: BlogView = isBlogView(cookieView) ? cookieView : 'list'
|
|
|
|
return (
|
|
<>
|
|
<script
|
|
type="application/ld+json"
|
|
dangerouslySetInnerHTML={{
|
|
__html: serializeJsonLd(breadcrumbListSchema(breadcrumbs.blogIndex)),
|
|
}}
|
|
/>
|
|
<BlogClient
|
|
initialBlogs={initialPosts}
|
|
totalPosts={allPosts.length}
|
|
initialView={initialView}
|
|
/>
|
|
</>
|
|
)
|
|
}
|