Several changes have been made to improve the user interface and enhance the user experience. This includes redesigning Auth buttons, modifying website layouts and routing, tweaking heading and text sizes for clarity, and revamping the marketing, documentation, and pricing pages. These changes collectively contribute to a cleaner, more concise and navigable interface.
62 lines
1.3 KiB
TypeScript
62 lines
1.3 KiB
TypeScript
import type { Metadata } from 'next';
|
|
|
|
import { notFound } from 'next/navigation';
|
|
|
|
import { createCmsClient } from '@kit/cms';
|
|
|
|
import { Post } from '~/(marketing)/blog/_components/post';
|
|
import { withI18n } from '~/lib/i18n/with-i18n';
|
|
|
|
export async function generateMetadata({
|
|
params,
|
|
}: {
|
|
params: { slug: string };
|
|
}): Promise<Metadata | undefined> {
|
|
const cms = await createCmsClient();
|
|
const post = await cms.getContentItemById(params.slug);
|
|
|
|
if (!post) {
|
|
notFound();
|
|
}
|
|
|
|
const { title, publishedAt, description, image } = post;
|
|
|
|
return Promise.resolve({
|
|
title,
|
|
description,
|
|
openGraph: {
|
|
title,
|
|
description,
|
|
type: 'article',
|
|
publishedTime: publishedAt.toDateString(),
|
|
url: post.url,
|
|
images: image
|
|
? [
|
|
{
|
|
url: image,
|
|
},
|
|
]
|
|
: [],
|
|
},
|
|
twitter: {
|
|
card: 'summary_large_image',
|
|
title,
|
|
description,
|
|
images: image ? [image] : [],
|
|
},
|
|
});
|
|
}
|
|
|
|
async function BlogPost({ params }: { params: { slug: string } }) {
|
|
const cms = await createCmsClient();
|
|
const post = await cms.getContentItemById(params.slug);
|
|
|
|
if (!post) {
|
|
notFound();
|
|
}
|
|
|
|
return <Post post={post} content={post.content} />;
|
|
}
|
|
|
|
export default withI18n(BlogPost);
|