Unify workspace dropdowns; Update layouts (#458)

Unified Account and Workspace drop-downs; Layout updates, now header lives within the PageBody component; Sidebars now use floating variant
This commit is contained in:
Giancarlo Buomprisco
2026-03-11 14:45:42 +08:00
committed by GitHub
parent ca585e09be
commit 4bc8448a1d
530 changed files with 14398 additions and 11198 deletions

View File

@@ -1,78 +0,0 @@
import { cache } from 'react';
import type { Metadata } from 'next';
import { notFound } from 'next/navigation';
import { createCmsClient } from '@kit/cms';
import { withI18n } from '~/lib/i18n/with-i18n';
import { Post } from '../../blog/_components/post';
interface BlogPageProps {
params: Promise<{ slug: string }>;
}
const getPostBySlug = cache(postLoader);
async function postLoader(slug: string) {
const client = await createCmsClient();
return client.getContentItemBySlug({ slug, collection: 'posts' });
}
export async function generateMetadata({
params,
}: BlogPageProps): Promise<Metadata> {
const slug = (await params).slug;
const post = await getPostBySlug(slug);
if (!post) {
notFound();
}
const { title, publishedAt, description, image } = post;
return Promise.resolve({
title,
description,
openGraph: {
title,
description,
type: 'article',
publishedTime: publishedAt,
url: post.url,
images: image
? [
{
url: image,
},
]
: [],
},
twitter: {
card: 'summary_large_image',
title,
description,
images: image ? [image] : [],
},
});
}
async function BlogPost({ params }: BlogPageProps) {
const slug = (await params).slug;
const post = await getPostBySlug(slug);
if (!post) {
notFound();
}
return (
<div className={'container sm:max-w-none sm:p-0'}>
<Post post={post} content={post.content} />
</div>
);
}
export default withI18n(BlogPost);