Sobreescrituras
Referencia del esquema de opciones de configuración de la integración de StudioCMS
export default function defineStudioCMSConfig(config: StudioCMSOptions): { dbStartPage?: boolean | undefined; rendererConfig?: { studiocms?: false | { callouts?: false | { theme?: "github" | "obsidian" | "vitepress" | undefined; } | undefined; autoLinkHeadings?: boolean | undefined; discordSubtext?: boolean | undefined; sanitize?: { allowElements?: string[] | undefined; blockElements?: string[] | undefined; dropElements?: string[] | undefined; allowAttributes?: Record<string, string[]> | undefined; dropAttributes?: Record<string, string[]> | undefined; allowComponents?: boolean | undefined; allowCustomElements?: boolean | undefined; allowComments?: boolean | undefined; } | undefined; } | undefined; renderer?: "studiocms" | CustomRenderer | "astro" | "markdoc" | "mdx" | undefined; markdocConfig?: { renderType?: "html" | MarkdocRenderer | "react-static" | undefined; argParse?: { file?: string | undefined; slots?: boolean | undefined; location?: boolean | undefined; } | undefined; transformConfig?: { tags?: Record<string, {}> | undefined; validation?: { parents?: any[] | undefined; validateFunctions?: boolean | undefined; environment?: string | undefined; } | undefined;...
A utility function to define the StudioCMS config object.
This function is used to define the optional StudioCMS
config object in the Astro project root. The expected file
name is studiocms.config.mjs
. And it should be adjacent
to the Astro project's astro.config.mjs
file.
StudioCMS will attempt to import this file and use the default
export as the StudioCMS config object automatically if it exists.
Using this function is optional, but it can be useful for IDEs
to provide better intellisense and type checking.
defineStudioCMSConfig({ overrides?: { CustomImageOverride?: string | undefined; FormattedDateOverride?: string | undefined;} | undefined
overrides: { CustomImageOverride?: string | undefined
CustomImageOverride: 'src/components/CustomImage.astro', FormattedDateOverride?: string | undefined
FormattedDateOverride: 'src/components/FormattedDate.astro', },});
CustomImageOverride
'Read the “', CustomImageOverride, '” section'CustomImageOverride
es una cadena que se utiliza para determinar la ruta al componente de imagen personalizado.
- Tipo:
string
- Valor predeterminado:
undefined
export default function defineStudioCMSConfig(config: StudioCMSOptions): { dbStartPage?: boolean | undefined; rendererConfig?: { studiocms?: false | { callouts?: false | { theme?: "github" | "obsidian" | "vitepress" | undefined; } | undefined; autoLinkHeadings?: boolean | undefined; discordSubtext?: boolean | undefined; sanitize?: { allowElements?: string[] | undefined; blockElements?: string[] | undefined; dropElements?: string[] | undefined; allowAttributes?: Record<string, string[]> | undefined; dropAttributes?: Record<string, string[]> | undefined; allowComponents?: boolean | undefined; allowCustomElements?: boolean | undefined; allowComments?: boolean | undefined; } | undefined; } | undefined; renderer?: "studiocms" | CustomRenderer | "astro" | "markdoc" | "mdx" | undefined; markdocConfig?: { renderType?: "html" | MarkdocRenderer | "react-static" | undefined; argParse?: { file?: string | undefined; slots?: boolean | undefined; location?: boolean | undefined; } | undefined; transformConfig?: { tags?: Record<string, {}> | undefined; validation?: { parents?: any[] | undefined; validateFunctions?: boolean | undefined; environment?: string | undefined; } | undefined;...
A utility function to define the StudioCMS config object.
This function is used to define the optional StudioCMS
config object in the Astro project root. The expected file
name is studiocms.config.mjs
. And it should be adjacent
to the Astro project's astro.config.mjs
file.
StudioCMS will attempt to import this file and use the default
export as the StudioCMS config object automatically if it exists.
Using this function is optional, but it can be useful for IDEs
to provide better intellisense and type checking.
defineStudioCMSConfig({ overrides?: { CustomImageOverride?: string | undefined; FormattedDateOverride?: string | undefined;} | undefined
overrides: { CustomImageOverride?: string | undefined
CustomImageOverride: 'src/components/CustomImage.astro', },})
FormattedDateOverride
'Read the “', FormattedDateOverride, '” section'FormattedDateOverride
es una cadena que se utiliza para determinar la ruta al componente de fecha personalizado.
- Tipo:
string
- Valor predeterminado:
undefined
export default function defineStudioCMSConfig(config: StudioCMSOptions): { dbStartPage?: boolean | undefined; rendererConfig?: { studiocms?: false | { callouts?: false | { theme?: "github" | "obsidian" | "vitepress" | undefined; } | undefined; autoLinkHeadings?: boolean | undefined; discordSubtext?: boolean | undefined; sanitize?: { allowElements?: string[] | undefined; blockElements?: string[] | undefined; dropElements?: string[] | undefined; allowAttributes?: Record<string, string[]> | undefined; dropAttributes?: Record<string, string[]> | undefined; allowComponents?: boolean | undefined; allowCustomElements?: boolean | undefined; allowComments?: boolean | undefined; } | undefined; } | undefined; renderer?: "studiocms" | CustomRenderer | "astro" | "markdoc" | "mdx" | undefined; markdocConfig?: { renderType?: "html" | MarkdocRenderer | "react-static" | undefined; argParse?: { file?: string | undefined; slots?: boolean | undefined; location?: boolean | undefined; } | undefined; transformConfig?: { tags?: Record<string, {}> | undefined; validation?: { parents?: any[] | undefined; validateFunctions?: boolean | undefined; environment?: string | undefined; } | undefined;...
A utility function to define the StudioCMS config object.
This function is used to define the optional StudioCMS
config object in the Astro project root. The expected file
name is studiocms.config.mjs
. And it should be adjacent
to the Astro project's astro.config.mjs
file.
StudioCMS will attempt to import this file and use the default
export as the StudioCMS config object automatically if it exists.
Using this function is optional, but it can be useful for IDEs
to provide better intellisense and type checking.
defineStudioCMSConfig({ overrides?: { CustomImageOverride?: string | undefined; FormattedDateOverride?: string | undefined;} | undefined
overrides: { FormattedDateOverride?: string | undefined
FormattedDateOverride: 'src/components/FormattedDate.astro', },})
Componente predeterminado
'Read the “', Componente predeterminado, '” section'---import config from 'studiocms:config';
interface Props { date: Date;}
const datetime = Astro.props.date.toISOString();const formattedDate = Astro.props.date.toLocaleDateString(config.dateLocale, config.dateTimeFormat);---
<time {datetime}>{formattedDate}</time>