Replaced contentlayer with keystatic

This commit is contained in:
giancarlo
2024-04-10 14:52:18 +08:00
parent f729bf6077
commit 006c4d430f
37 changed files with 2842 additions and 2776 deletions

View File

@@ -4,9 +4,10 @@ import { notFound } from 'next/navigation';
import { createCmsClient } from '@kit/cms';
import { Post } from '~/(marketing)/blog/_components/post';
import { withI18n } from '~/lib/i18n/with-i18n';
import { Post } from '../../blog/_components/post';
export async function generateMetadata({
params,
}: {

View File

@@ -21,6 +21,7 @@ export function PostPreview({
}: React.PropsWithChildren<Props>) {
const { title, image, publishedAt, description } = post;
const height = imageHeight ?? DEFAULT_IMAGE_HEIGHT;
const slug = `/blog/${post.slug}`;
return (

View File

@@ -6,7 +6,7 @@ import { PostHeader } from './post-header';
export const Post: React.FC<{
post: Cms.ContentItem;
content: string;
content: unknown;
}> = ({ post, content }) => {
return (
<div>