From f7404af4af2ee53a9ff4966302bdd9d4b6ec3528 Mon Sep 17 00:00:00 2001 From: Emma Hamilton Date: Tue, 6 Aug 2024 12:43:19 +1000 Subject: [PATCH] Add docs for `fields.markdoc.inline` and `fields.mdx.inline` --- docs/src/content/pages/fields/markdoc.mdoc | 21 +++++++++++++++++++++ docs/src/content/pages/fields/mdx.mdoc | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/docs/src/content/pages/fields/markdoc.mdoc b/docs/src/content/pages/fields/markdoc.mdoc index 149ddde1a..82d5cb7e1 100644 --- a/docs/src/content/pages/fields/markdoc.mdoc +++ b/docs/src/content/pages/fields/markdoc.mdoc @@ -55,6 +55,27 @@ Checkout the [content components](/docs/content-components) docs to learn how to --- +## Inline + +By default, `fields.markdoc` will output content in a seperate file to the main data or below the main data if using `format.contentField`. If you want to have multiple pieces of content in the same file, you can use `fields.markdoc.inline(...)`: + +```tsx +someContent: fields.markdoc.inline({ + label: 'Some content', +}) +``` + +this will write content next to other fields like this instead of in a different file: + +```yaml +someContent: | + # Title + + Some content +``` + +--- + ## Type signature Find the latest version of this field's type signature at: [https://docsmill.dev/npm/@keystatic/core#/.fields.markdoc](https://docsmill.dev/npm/@keystatic/core#/.fields.markdoc) diff --git a/docs/src/content/pages/fields/mdx.mdoc b/docs/src/content/pages/fields/mdx.mdoc index 50ec59ebf..4e0bfc85e 100644 --- a/docs/src/content/pages/fields/mdx.mdoc +++ b/docs/src/content/pages/fields/mdx.mdoc @@ -104,6 +104,27 @@ For example... --- +## Inline + +By default, `fields.mdx` will output content in a seperate file to the main data or below the main data if using `format.contentField`. If you want to have multiple pieces of content in the same file, you can use `fields.mdx.inline(...)` instead: + +```tsx +someContent: fields.mdx.inline({ + label: 'Some content', +}) +``` + +this will write content next to other fields like this instead of in a different file: + +```yaml +someContent: | + # Title + + Some content +``` + +--- + ## Type signature Find the latest version of this field's type signature at: [https://docsmill.dev/npm/@keystatic/core#/.fields.mdx](https://docsmill.dev/npm/@keystatic/core#/.fields.mdx)