Update content rendering method in Keystatic package

This commit changes the way content is handled in the Keystatic package. It introduces rendering the content to HTML in the Keystatic client rather than in the content renderer component. This simplifies the rendering processing and better utilises the properties of the Markdoc library.
This commit is contained in:
giancarlo
2024-05-07 20:07:09 +07:00
parent 951acd38a5
commit d06882898a
3 changed files with 8 additions and 9 deletions

View File

@@ -1,3 +1,5 @@
import { KeystaticContentRenderer } from '@kit/keystatic';
import type { CmsType } from './cms.type';
const CMS_CLIENT = process.env.CMS_CLIENT as CmsType;
@@ -13,11 +15,11 @@ export async function ContentRenderer({
}: ContentRendererProps) {
switch (type) {
case 'keystatic': {
const { KeystaticDocumentRenderer } = await import(
const { KeystaticContentRenderer } = await import(
'../../keystatic/src/content-renderer'
);
return <KeystaticDocumentRenderer content={content} />;
return <KeystaticContentRenderer content={content} />;
}
case 'wordpress': {