Integrate Markdoc library with Keystatic CMS.
The commit introduces the '@markdoc/markdoc' library to the Keystatic CMS. It modifies related functions and components such as 'KeystaticDocumentRenderer' and 'keystatic-client' to transform and render content using Markdoc. Additionally, the commit refactors 'keystatic.config.ts' file for more legible content field setup and adds related dependencies in the package.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { DocumentElement } from '@keystatic/core';
|
||||
import { DocumentRenderer } from '@keystatic/core/renderer';
|
||||
import * as React from 'react';
|
||||
|
||||
export function KeystaticDocumentRenderer(props: { content: unknown }) {
|
||||
return <DocumentRenderer document={props.content as DocumentElement[]} />;
|
||||
import Markdoc from '@markdoc/markdoc';
|
||||
|
||||
export function KeystaticDocumentRenderer({ content }: { content: unknown }) {
|
||||
return Markdoc.renderers.react(content as string, React);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user