Replaced contentlayer with keystatic
This commit is contained in:
@@ -8,7 +8,10 @@ NEXT_PUBLIC_THEME_COLOR="#ffffff"
|
||||
NEXT_PUBLIC_THEME_COLOR_DARK="#0a0a0a"
|
||||
|
||||
# CMS
|
||||
CMS_CLIENT=contentlayer
|
||||
CMS_CLIENT=keystatic
|
||||
|
||||
# KEYSTATIC
|
||||
NEXT_PUBLIC_KEYSTATIC_CONTENT_PATH=./content
|
||||
|
||||
# AUTH
|
||||
NEXT_PUBLIC_AUTH_PASSWORD=true
|
||||
|
||||
@@ -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,
|
||||
}: {
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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>
|
||||
|
||||
8
apps/web/content/posts/my-post.mdoc
Normal file
8
apps/web/content/posts/my-post.mdoc
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
title: hello
|
||||
description: hello
|
||||
categories: ['blog']
|
||||
tags: []
|
||||
---
|
||||
|
||||
ddfdsfjsdnfjdks
|
||||
@@ -5,10 +5,12 @@
|
||||
export async function register() {
|
||||
// only run in nodejs runtime
|
||||
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
||||
const { registerInstrumentation } = await import('@kit/monitoring');
|
||||
const { registerMonitoringInstrumentation } = await import(
|
||||
'@kit/monitoring'
|
||||
);
|
||||
|
||||
// Register monitoring instrumentation based on the
|
||||
// MONITORING_INSTRUMENTATION_PROVIDER environment variable.
|
||||
return registerInstrumentation();
|
||||
return registerMonitoringInstrumentation();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
"@kit/tsconfig": "workspace:^",
|
||||
"@next/bundle-analyzer": "14.2.0-canary.54",
|
||||
"@types/mdx": "^2.0.12",
|
||||
"@types/node": "^20.12.3",
|
||||
"@types/node": "^20.12.7",
|
||||
"@types/react": "^18.2.75",
|
||||
"@types/react-dom": "^18.2.22",
|
||||
"autoprefixer": "^10.4.19",
|
||||
|
||||
Reference in New Issue
Block a user