config
Functions
'Read the “', Functions, '” section'defineStudioCMSConfig()
'Read the “', defineStudioCMSConfig(), '” section'function defineStudioCMSConfig(config: | undefined | { componentRegistry: Record<string, string>; dashboardConfig: { AuthConfig: { enabled: boolean; providers: { auth0: boolean; discord: boolean; github: boolean; google: boolean; usernameAndPassword: boolean; usernameAndPasswordConfig: { allowUserRegistration: ... | ... | ...; }; }; }; dashboardEnabled: boolean; dashboardRouteOverride: string; developerConfig: { testingAndDemoMode: boolean; }; faviconURL: string; inject404Route: boolean; versionCheck: boolean; }; dateLocale: string; dateTimeFormat: DateTimeFormatOptions; dbStartPage: boolean; defaultFrontEndConfig: | boolean | { favicon: string; htmlDefaultHead: { attrs: Record<string, undefined | string | boolean>; content: string; tag: | "title" | "base" | "link" | "style" | "meta" | "script" | "noscript" | "template"; }[]; htmlDefaultLanguage: string; injectQuickActionsMenu: boolean; }; imageService: { cdnPlugin: "cloudinary-js"; }; includedIntegrations: { robotsTXT: | boolean | RobotsConfig; }; overrides: { CustomImageOverride: string; FormattedDateOverride: string; }; plugins: StudioCMSPlugin[]; rendererConfig: { markdocConfig: { argParse: { file: string; location: boolean; slots: boolean; }; renderType: | "html" | "react-static" | MarkdocRenderer; transformConfig: { functions: Record<string, any>; nodes: Record<string, {}>; partials: Record<string, any>; tags: Record<string, {}>; validation: { environment: ... | ...; parents: ... | ...; validateFunctions: ... | ... | ...; }; variables: Record<string, any>; }; }; mdxConfig: { recmaPlugins: PluggableList; rehypePlugins: PluggableList; remarkPlugins: PluggableList; remarkRehypeOptions: { allowDangerousHtml: null | boolean; clobberPrefix: null | string; file: any; footnoteBackContent: | null | string | (...args: [..., ..., ...(...)[]]) => ... | ... | ... | ... | ...; footnoteBackLabel: null | string | (...args: [..., ..., ...(...)[]]) => string; footnoteLabel: null | string; footnoteLabelProperties: | null | Record<string, ... | ... | ... | ... | ... | ... | ...>; footnoteLabelTagName: null | string; handlers: any; passThrough: null | string[]; unknownHandler: any; }; }; renderer: | "studiocms" | "astro" | "markdoc" | "mdx" | CustomRenderer; studiocms: | false | { autoLinkHeadings: boolean; callouts: | false | { theme: "github" | "obsidian" | "vitepress"; }; discordSubtext: boolean; sanitize: { allowAttributes: Record<string, ...[]>; allowComments: boolean; allowComponents: boolean; allowCustomElements: boolean; allowElements: string[]; blockElements: string[]; dropAttributes: Record<string, ...[]>; dropElements: string[]; }; }; }; sdk: | boolean | { cacheConfig: | boolean | { lifetime: string; }; }; verbose: boolean; }): | undefined | { componentRegistry: Record<string, string>; dashboardConfig: { AuthConfig: { enabled: boolean; providers: { auth0: boolean; discord: boolean; github: boolean; google: boolean; usernameAndPassword: boolean; usernameAndPasswordConfig: { allowUserRegistration: ... | ... | ...; }; }; }; dashboardEnabled: boolean; dashboardRouteOverride: string; developerConfig: { testingAndDemoMode: boolean; }; faviconURL: string; inject404Route: boolean; versionCheck: boolean; }; dateLocale: string; dateTimeFormat: DateTimeFormatOptions; dbStartPage: boolean; defaultFrontEndConfig: | boolean | { favicon: string; htmlDefaultHead: { attrs: Record<string, undefined | string | boolean>; content: string; tag: | "title" | "base" | "link" | "style" | "meta" | "script" | "noscript" | "template"; }[]; htmlDefaultLanguage: string; injectQuickActionsMenu: boolean; }; imageService: { cdnPlugin: "cloudinary-js"; }; includedIntegrations: { robotsTXT: | boolean | RobotsConfig; }; overrides: { CustomImageOverride: string; FormattedDateOverride: string; }; plugins: StudioCMSPlugin[]; rendererConfig: { markdocConfig: { argParse: { file: string; location: boolean; slots: boolean; }; renderType: | "html" | "react-static" | MarkdocRenderer; transformConfig: { functions: Record<string, any>; nodes: Record<string, {}>; partials: Record<string, any>; tags: Record<string, {}>; validation: { environment: ... | ...; parents: ... | ...; validateFunctions: ... | ... | ...; }; variables: Record<string, any>; }; }; mdxConfig: { recmaPlugins: PluggableList; rehypePlugins: PluggableList; remarkPlugins: PluggableList; remarkRehypeOptions: { allowDangerousHtml: null | boolean; clobberPrefix: null | string; file: any; footnoteBackContent: | null | string | (...args: [..., ..., ...(...)[]]) => ... | ... | ... | ... | ...; footnoteBackLabel: null | string | (...args: [..., ..., ...(...)[]]) => string; footnoteLabel: null | string; footnoteLabelProperties: | null | Record<string, ... | ... | ... | ... | ... | ... | ...>; footnoteLabelTagName: null | string; handlers: any; passThrough: null | string[]; unknownHandler: any; }; }; renderer: | "studiocms" | "astro" | "markdoc" | "mdx" | CustomRenderer; studiocms: | false | { autoLinkHeadings: boolean; callouts: | false | { theme: "github" | "obsidian" | "vitepress"; }; discordSubtext: boolean; sanitize: { allowAttributes: Record<string, ...[]>; allowComments: boolean; allowComponents: boolean; allowCustomElements: boolean; allowElements: string[]; blockElements: string[]; dropAttributes: Record<string, ...[]>; dropElements: string[]; }; }; }; sdk: | boolean | { cacheConfig: | boolean | { lifetime: string; }; }; verbose: boolean;}
Defined in: studiocms/packages/studiocms/src/utils/defineStudioCMSConfig.ts:31
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.
Parameters
'Read the “', Parameters, '” section'undefined
|
{
componentRegistry
: Record
<string
, string
>;
dashboardConfig
: {
AuthConfig
: {
enabled
: boolean
;
providers
: {
auth0
: boolean
;
discord
: boolean
;
github
: boolean
;
google
: boolean
;
usernameAndPassword
: boolean
;
usernameAndPasswordConfig
: {
allowUserRegistration
: … | … | …;
};
};
};
dashboardEnabled
: boolean
;
dashboardRouteOverride
: string
;
developerConfig
: {
testingAndDemoMode
: boolean
;
};
faviconURL
: string
;
inject404Route
: boolean
;
versionCheck
: boolean
;
};
dateLocale
: string
;
dateTimeFormat
: DateTimeFormatOptions
;
dbStartPage
: boolean
;
defaultFrontEndConfig
: | boolean
| {
favicon
: string
;
htmlDefaultHead
: {
attrs
: Record
<string
, undefined
| string
| boolean
>;
content
: string
;
tag
: | "title"
| "base"
| "link"
| "style"
| "meta"
| "script"
| "noscript"
| "template"
;
}[];
htmlDefaultLanguage
: string
;
injectQuickActionsMenu
: boolean
;
};
imageService
: {
cdnPlugin
: "cloudinary-js"
;
};
includedIntegrations
: {
robotsTXT
: | boolean
| RobotsConfig
;
};
overrides
: {
CustomImageOverride
: string
;
FormattedDateOverride
: string
;
};
plugins
: StudioCMSPlugin
[];
rendererConfig
: {
markdocConfig
: {
argParse
: {
file
: string
;
location
: boolean
;
slots
: boolean
;
};
renderType
: | "html"
| "react-static"
| MarkdocRenderer
;
transformConfig
: {
functions
: Record
<string
, any
>;
nodes
: Record
<string
, {}>;
partials
: Record
<string
, any
>;
tags
: Record
<string
, {}>;
validation
: {
environment
: … | …;
parents
: … | …;
validateFunctions
: … | … | …;
};
variables
: Record
<string
, any
>;
};
};
mdxConfig
: {
recmaPlugins
: PluggableList
;
rehypePlugins
: PluggableList
;
remarkPlugins
: PluggableList
;
remarkRehypeOptions
: {
allowDangerousHtml
: null
| boolean
;
clobberPrefix
: null
| string
;
file
: any
;
footnoteBackContent
: | null
| string
| (…args
: […, …, ...(...)[]
]) => … | … | … | … | …;
footnoteBackLabel
: null
| string
| (…args
: […, …, ...(...)[]
]) => string
;
footnoteLabel
: null
| string
;
footnoteLabelProperties
: | null
| Record
<string
, … | … | … | … | … | … | …>;
footnoteLabelTagName
: null
| string
;
handlers
: any
;
passThrough
: null
| string
[];
unknownHandler
: any
;
};
};
renderer
: | "studiocms"
| "astro"
| "markdoc"
| "mdx"
| CustomRenderer
;
studiocms
: | false
| {
autoLinkHeadings
: boolean
;
callouts
: | false
| {
theme
: "github"
| "obsidian"
| "vitepress"
;
};
discordSubtext
: boolean
;
sanitize
: {
allowAttributes
: Record
<string
, …[]>;
allowComments
: boolean
;
allowComponents
: boolean
;
allowCustomElements
: boolean
;
allowElements
: string
[];
blockElements
: string
[];
dropAttributes
: Record
<string
, …[]>;
dropElements
: string
[];
};
};
};
sdk
: | boolean
| {
cacheConfig
: | boolean
| {
lifetime
: string
;
};
};
verbose
: boolean
;
}
componentRegistry?
'Read the “', componentRegistry?, '” section'Record
<string
, string
> = ...
Component Registry
dashboardConfig?
'Read the “', dashboardConfig?, '” section'{
AuthConfig
: {
enabled
: boolean
;
providers
: {
auth0
: boolean
;
discord
: boolean
;
github
: boolean
;
google
: boolean
;
usernameAndPassword
: boolean
;
usernameAndPasswordConfig
: {
allowUserRegistration
: … | … | …;
};
};
};
dashboardEnabled
: boolean
;
dashboardRouteOverride
: string
;
developerConfig
: {
testingAndDemoMode
: boolean
;
};
faviconURL
: string
;
inject404Route
: boolean
;
versionCheck
: boolean
;
} = dashboardConfigSchema
Allows customization of the Dashboard Configuration
dashboardConfig.AuthConfig?
'Read the “', dashboardConfig.AuthConfig?, '” section'{
enabled
: boolean
;
providers
: {
auth0
: boolean
;
discord
: boolean
;
github
: boolean
;
google
: boolean
;
usernameAndPassword
: boolean
;
usernameAndPasswordConfig
: {
allowUserRegistration
: … | … | …;
};
};
} = authConfigSchema
Auth Configuration - Allows customization of the Authentication Configuration
dashboardConfig.AuthConfig.enabled?
'Read the “', dashboardConfig.AuthConfig.enabled?, '” section'boolean
= ...
Auth Enabled - Allows enabling or disabling of the Authentication Configuration
Default
true
dashboardConfig.AuthConfig.providers?
'Read the “', dashboardConfig.AuthConfig.providers?, '” section'{
auth0
: boolean
;
discord
: boolean
;
github
: boolean
;
google
: boolean
;
usernameAndPassword
: boolean
;
usernameAndPasswordConfig
: {
allowUserRegistration
: … | … | …;
};
} = authProviderSchema
Auth Providers - Allows enabling or disabling of the Authentication Providers
dashboardConfig.AuthConfig.providers.auth0?
'Read the “', dashboardConfig.AuthConfig.providers.auth0?, '” section'boolean
= ...
Auth0 Auth Provider - Powered by Arctic
Requires an Auth0 Application to be created and configured using ENV Variables
Default
false
dashboardConfig.AuthConfig.providers.discord?
'Read the “', dashboardConfig.AuthConfig.providers.discord?, '” section'boolean
= ...
Discord Auth Provider - Powered by Arctic
Requires a Discord OAuth App to be created and configured using ENV Variables
Default
false
dashboardConfig.AuthConfig.providers.github?
'Read the “', dashboardConfig.AuthConfig.providers.github?, '” section'boolean
= ...
GitHub Auth Provider - Powered by Arctic
Requires a GitHub OAuth App to be created and configured using ENV Variables
Default
false
dashboardConfig.AuthConfig.providers.google?
'Read the “', dashboardConfig.AuthConfig.providers.google?, '” section'boolean
= ...
Google Auth Provider - Powered by Arctic
Requires a Google OAuth App to be created and configured using ENV Variables
Default
false
dashboardConfig.AuthConfig.providers.usernameAndPassword?
'Read the “', dashboardConfig.AuthConfig.providers.usernameAndPassword?, '” section'boolean
= ...
Username and Password Auth Provider
dashboardConfig.AuthConfig.providers.usernameAndPasswordConfig?
'Read the “', dashboardConfig.AuthConfig.providers.usernameAndPasswordConfig?, '” section'{
allowUserRegistration
: … | … | …;
} = localUsernameAndPasswordConfig
dashboardConfig.AuthConfig.providers.usernameAndPasswordConfig.allowUserRegistration?
'Read the “', dashboardConfig.AuthConfig.providers.usernameAndPasswordConfig.allowUserRegistration?, '” section'… | … | … = ...
Allow User Registration - Allows users to register an account
Default
false
dashboardConfig.dashboardEnabled?
'Read the “', dashboardConfig.dashboardEnabled?, '” section'boolean
= ...
OPTIONAL - This allows the user to enable or disable the Astro StudioCMS dashboard but still provide all the helper’s and utilities to those who are customizing their setup, doing so will disable the dashboard and you will need to manage your content via your database
Default
true
dashboardConfig.dashboardRouteOverride?
'Read the “', dashboardConfig.dashboardRouteOverride?, '” section'string
= ...
OPTIONAL - This allows the user to override the default dashboard route to a custom route
Note: Use with caution, this is an advanced feature
Usage
- The default route is
dashboard
without any/
or\
characters. If you want to override the route to/admin
you would set this value toadmin
Default
"dashboard"
dashboardConfig.developerConfig?
'Read the “', dashboardConfig.developerConfig?, '” section'{
testingAndDemoMode
: boolean
;
} = developerConfigSchema
Developer Options/Configuration
dashboardConfig.developerConfig.testingAndDemoMode?
'Read the “', dashboardConfig.developerConfig.testingAndDemoMode?, '” section'boolean
= ...
Enable Testing and Demo Mode
This will enable the testing and demo mode for the Astro StudioCMS dashboard, this will allow you to test the dashboard without having to authenticate. This is useful for testing and demo purposes as it will allow you to see how the dashboard works and looks but disable any changes to the database.
Default
false
dashboardConfig.faviconURL?
'Read the “', dashboardConfig.faviconURL?, '” section'string
= ...
OPTIONAL - This allows the user to override the default Favicon URL to a custom URL
dashboardConfig.inject404Route?
'Read the “', dashboardConfig.inject404Route?, '” section'boolean
= ...
OPTIONAL - This allows the user to enable or disable the default 404 route for the dashboard
Default
true
dashboardConfig.versionCheck?
'Read the “', dashboardConfig.versionCheck?, '” section'boolean
= ...
OPTIONAL - This allows the user to enable or disable the version check for the dashboard
This will check for the latest version of StudioCMS and notify the user if there is a new version available.
Default
true
dateLocale?
'Read the “', dateLocale?, '” section'string
= ...
Date Locale used for formatting dates
dateTimeFormat?
'Read the “', dateTimeFormat?, '” section'DateTimeFormatOptions
= ...
DateTime Format Options
dbStartPage?
'Read the “', dbStartPage?, '” section'boolean
= ...
Project Initialization Page - Used during First Time Setup to initialize the database
Default
true
defaultFrontEndConfig?
'Read the “', defaultFrontEndConfig?, '” section'| boolean
| {
favicon
: string
;
htmlDefaultHead
: {
attrs
: Record
<string
, undefined
| string
| boolean
>;
content
: string
;
tag
: | "title"
| "base"
| "link"
| "style"
| "meta"
| "script"
| "noscript"
| "template"
;
}[];
htmlDefaultLanguage
: string
;
injectQuickActionsMenu
: boolean
;
} = DefaultFrontEndConfigSchema
Default Frontend Configuration
Allows customization of the default frontend configuration
Default
true
imageService?
'Read the “', imageService?, '” section'{
cdnPlugin
: "cloudinary-js"
;
} = imageServiceSchema
Allows customization of the Image Service Options
imageService.cdnPlugin?
'Read the “', imageService.cdnPlugin?, '” section'"cloudinary-js"
= ...
If the user wants to use a custom Supported CDN Plugin, they can specify it here.
Currently Supported CDN Plugins: cloudinary-js
includedIntegrations?
'Read the “', includedIntegrations?, '” section'{
robotsTXT
: | boolean
| RobotsConfig
;
} = includedIntegrationsSchema
Allows enabling and disabling of the included integrations
includedIntegrations.robotsTXT?
'Read the “', includedIntegrations.robotsTXT?, '” section'| boolean
| RobotsConfig
= ...
Allows the user to enable/disable the use of the StudioCMS Custom astro-robots-txt
Integration
Default
robotsTXT: { policy: [ { userAgent: ['*'], allow: ['/'], disallow: ['/dashboard/'] } ] }
overrides?
'Read the “', overrides?, '” section'{
CustomImageOverride
: string
;
FormattedDateOverride
: string
;
} = overridesSchema
Component Overrides - Allows for customizing the components used in StudioCMS
overrides.CustomImageOverride?
'Read the “', overrides.CustomImageOverride?, '” section'string
= ...
Allows the user to override the default image component used in StudioCMS for rendering images.
overrides.FormattedDateOverride?
'Read the “', overrides.FormattedDateOverride?, '” section'string
= ...
Allows the user to override the default formatted date component used in StudioCMS for rendering dates.
StudioCMSPlugin
[] = ...
Add Plugins to the StudioCMS
rendererConfig?
'Read the “', rendererConfig?, '” section'{
markdocConfig
: {
argParse
: {
file
: string
;
location
: boolean
;
slots
: boolean
;
};
renderType
: | "html"
| "react-static"
| MarkdocRenderer
;
transformConfig
: {
functions
: Record
<string
, any
>;
nodes
: Record
<string
, {}>;
partials
: Record
<string
, any
>;
tags
: Record
<string
, {}>;
validation
: {
environment
: … | …;
parents
: … | …;
validateFunctions
: … | … | …;
};
variables
: Record
<string
, any
>;
};
};
mdxConfig
: {
recmaPlugins
: PluggableList
;
rehypePlugins
: PluggableList
;
remarkPlugins
: PluggableList
;
remarkRehypeOptions
: {
allowDangerousHtml
: null
| boolean
;
clobberPrefix
: null
| string
;
file
: any
;
footnoteBackContent
: | null
| string
| (…args
: […, …, ...(...)[]
]) => … | … | … | … | …;
footnoteBackLabel
: null
| string
| (…args
: […, …, ...(...)[]
]) => string
;
footnoteLabel
: null
| string
;
footnoteLabelProperties
: | null
| Record
<string
, … | … | … | … | … | … | …>;
footnoteLabelTagName
: null
| string
;
handlers
: any
;
passThrough
: null
| string
[];
unknownHandler
: any
;
};
};
renderer
: | "studiocms"
| "astro"
| "markdoc"
| "mdx"
| CustomRenderer
;
studiocms
: | false
| {
autoLinkHeadings
: boolean
;
callouts
: | false
| {
theme
: "github"
| "obsidian"
| "vitepress"
;
};
discordSubtext
: boolean
;
sanitize
: {
allowAttributes
: Record
<string
, …[]>;
allowComments
: boolean
;
allowComponents
: boolean
;
allowCustomElements
: boolean
;
allowElements
: string
[];
blockElements
: string
[];
dropAttributes
: Record
<string
, …[]>;
dropElements
: string
[];
};
};
} = StudioCMSRendererConfigSchema
Renderer Configuration
Allows customization of the current renderer being used
rendererConfig.markdocConfig?
'Read the “', rendererConfig.markdocConfig?, '” section'{
argParse
: {
file
: string
;
location
: boolean
;
slots
: boolean
;
};
renderType
: | "html"
| "react-static"
| MarkdocRenderer
;
transformConfig
: {
functions
: Record
<string
, any
>;
nodes
: Record
<string
, {}>;
partials
: Record
<string
, any
>;
tags
: Record
<string
, {}>;
validation
: {
environment
: … | …;
parents
: … | …;
validateFunctions
: … | … | …;
};
variables
: Record
<string
, any
>;
};
} = markdocConfigSchema
Allows customization of the Markdoc Configuration
Markdoc is a powerful, flexible, Markdown-based authoring framework. Built by Stripe.
See
https://markdoc.dev/^ for more info about markdoc.
rendererConfig.markdocConfig.argParse?
'Read the “', rendererConfig.markdocConfig.argParse?, '” section'{
file
: string
;
location
: boolean
;
slots
: boolean
;
} = ...
The MarkDoc Arg Parse to use for rendering pages and posts
rendererConfig.markdocConfig.argParse.file?
'Read the “', rendererConfig.markdocConfig.argParse.file?, '” section'string
= ...
rendererConfig.markdocConfig.argParse.location?
'Read the “', rendererConfig.markdocConfig.argParse.location?, '” section'boolean
= ...
rendererConfig.markdocConfig.argParse.slots?
'Read the “', rendererConfig.markdocConfig.argParse.slots?, '” section'boolean
= ...
rendererConfig.markdocConfig.renderType?
'Read the “', rendererConfig.markdocConfig.renderType?, '” section'| "html"
| "react-static"
| MarkdocRenderer
= ...
The MarkDoc Content Renderer to use for rendering pages and posts
Can be one of the following: html
, react-static
, or a custom renderer
rendererConfig.markdocConfig.transformConfig?
'Read the “', rendererConfig.markdocConfig.transformConfig?, '” section'{
functions
: Record
<string
, any
>;
nodes
: Record
<string
, {}>;
partials
: Record
<string
, any
>;
tags
: Record
<string
, {}>;
validation
: {
environment
: … | …;
parents
: … | …;
validateFunctions
: … | … | …;
};
variables
: Record
<string
, any
>;
} = ...
The MarkDoc Transform Config to use for rendering pages and posts
See
https://markdoc.dev/docs/config^
rendererConfig.markdocConfig.transformConfig.functions?
'Read the “', rendererConfig.markdocConfig.transformConfig.functions?, '” section'Record
<string
, any
> = ...
rendererConfig.markdocConfig.transformConfig.nodes?
'Read the “', rendererConfig.markdocConfig.transformConfig.nodes?, '” section'Record
<string
, {}> = ...
rendererConfig.markdocConfig.transformConfig.partials?
'Read the “', rendererConfig.markdocConfig.transformConfig.partials?, '” section'Record
<string
, any
> = ...
rendererConfig.markdocConfig.transformConfig.tags?
'Read the “', rendererConfig.markdocConfig.transformConfig.tags?, '” section'Record
<string
, {}> = ...
rendererConfig.markdocConfig.transformConfig.validation?
'Read the “', rendererConfig.markdocConfig.transformConfig.validation?, '” section'{
environment
: … | …;
parents
: … | …;
validateFunctions
: … | … | …;
} = ...
rendererConfig.markdocConfig.transformConfig.validation.environment?
'Read the “', rendererConfig.markdocConfig.transformConfig.validation.environment?, '” section'… | … = ...
rendererConfig.markdocConfig.transformConfig.validation.parents?
'Read the “', rendererConfig.markdocConfig.transformConfig.validation.parents?, '” section'… | … = ...
rendererConfig.markdocConfig.transformConfig.validation.validateFunctions?
'Read the “', rendererConfig.markdocConfig.transformConfig.validation.validateFunctions?, '” section'… | … | … = ...
rendererConfig.markdocConfig.transformConfig.variables?
'Read the “', rendererConfig.markdocConfig.transformConfig.variables?, '” section'Record
<string
, any
> = ...
rendererConfig.mdxConfig?
'Read the “', rendererConfig.mdxConfig?, '” section'{
recmaPlugins
: PluggableList
;
rehypePlugins
: PluggableList
;
remarkPlugins
: PluggableList
;
remarkRehypeOptions
: {
allowDangerousHtml
: null
| boolean
;
clobberPrefix
: null
| string
;
file
: any
;
footnoteBackContent
: | null
| string
| (…args
: […, …, ...(...)[]
]) => … | … | … | … | …;
footnoteBackLabel
: null
| string
| (…args
: […, …, ...(...)[]
]) => string
;
footnoteLabel
: null
| string
;
footnoteLabelProperties
: | null
| Record
<string
, … | … | … | … | … | … | …>;
footnoteLabelTagName
: null
| string
;
handlers
: any
;
passThrough
: null
| string
[];
unknownHandler
: any
;
};
} = mdxConfigSchema
Allows customization of the MDX Configuration
MDX is a JSX in Markdown loader, parser, and renderer for ambitious projects.
See
https://mdxjs.com/^ for more info about MDX.
rendererConfig.mdxConfig.recmaPlugins?
'Read the “', rendererConfig.mdxConfig.recmaPlugins?, '” section'PluggableList
= ...
List of recma plugins (optional); this is a new ecosystem, currently in beta, to transform esast trees (JavaScript)
rendererConfig.mdxConfig.rehypePlugins?
'Read the “', rendererConfig.mdxConfig.rehypePlugins?, '” section'PluggableList
= ...
List of rehype plugins (optional).
rendererConfig.mdxConfig.remarkPlugins?
'Read the “', rendererConfig.mdxConfig.remarkPlugins?, '” section'PluggableList
= ...
List of remark plugins (optional).
rendererConfig.mdxConfig.remarkRehypeOptions?
'Read the “', rendererConfig.mdxConfig.remarkRehypeOptions?, '” section'{
allowDangerousHtml
: null
| boolean
;
clobberPrefix
: null
| string
;
file
: any
;
footnoteBackContent
: | null
| string
| (…args
: […, …, ...(...)[]
]) => … | … | … | … | …;
footnoteBackLabel
: null
| string
| (…args
: […, …, ...(...)[]
]) => string
;
footnoteLabel
: null
| string
;
footnoteLabelProperties
: | null
| Record
<string
, … | … | … | … | … | … | …>;
footnoteLabelTagName
: null
| string
;
handlers
: any
;
passThrough
: null
| string
[];
unknownHandler
: any
;
} = ...
Options to pass through to remark-rehype (optional); the option allowDangerousHtml will always be set to true and the MDX nodes (see nodeTypes) are passed through; In particular, you might want to pass configuration for footnotes if your content is not in English.
rendererConfig.mdxConfig.remarkRehypeOptions.allowDangerousHtml?
'Read the “', rendererConfig.mdxConfig.remarkRehypeOptions.allowDangerousHtml?, '” section'null
| boolean
= ...
rendererConfig.mdxConfig.remarkRehypeOptions.clobberPrefix?
'Read the “', rendererConfig.mdxConfig.remarkRehypeOptions.clobberPrefix?, '” section'null
| string
= ...
rendererConfig.mdxConfig.remarkRehypeOptions.file?
'Read the “', rendererConfig.mdxConfig.remarkRehypeOptions.file?, '” section'any
= ...
rendererConfig.mdxConfig.remarkRehypeOptions.footnoteBackContent?
'Read the “', rendererConfig.mdxConfig.remarkRehypeOptions.footnoteBackContent?, '” section'| null
| string
| (…args
: […, …, ...(...)[]
]) => … | … | … | … | … = ...
rendererConfig.mdxConfig.remarkRehypeOptions.footnoteBackLabel?
'Read the “', rendererConfig.mdxConfig.remarkRehypeOptions.footnoteBackLabel?, '” section'null
| string
| (…args
: […, …, ...(...)[]
]) => string
= ...
rendererConfig.mdxConfig.remarkRehypeOptions.footnoteLabel?
'Read the “', rendererConfig.mdxConfig.remarkRehypeOptions.footnoteLabel?, '” section'null
| string
= ...
rendererConfig.mdxConfig.remarkRehypeOptions.footnoteLabelProperties?
'Read the “', rendererConfig.mdxConfig.remarkRehypeOptions.footnoteLabelProperties?, '” section'| null
| Record
<string
, … | … | … | … | … | … | …> = ...
rendererConfig.mdxConfig.remarkRehypeOptions.footnoteLabelTagName?
'Read the “', rendererConfig.mdxConfig.remarkRehypeOptions.footnoteLabelTagName?, '” section'null
| string
= ...
rendererConfig.mdxConfig.remarkRehypeOptions.handlers?
'Read the “', rendererConfig.mdxConfig.remarkRehypeOptions.handlers?, '” section'any
= ...
rendererConfig.mdxConfig.remarkRehypeOptions.passThrough?
'Read the “', rendererConfig.mdxConfig.remarkRehypeOptions.passThrough?, '” section'null
| string
[] = ...
rendererConfig.mdxConfig.remarkRehypeOptions.unknownHandler?
'Read the “', rendererConfig.mdxConfig.remarkRehypeOptions.unknownHandler?, '” section'any
= ...
rendererConfig.renderer?
'Read the “', rendererConfig.renderer?, '” section'| "studiocms"
| "astro"
| "markdoc"
| "mdx"
| CustomRenderer
= ...
The Markdown Content Renderer to use for rendering pages and posts
Astro is the built-in Astro remark-markdown plugin.
See
Markdoc is a powerful, flexible, Markdown-based authoring framework. Built by Stripe.
- https://markdoc.dev/^ for more info about markdoc.
rendererConfig.studiocms?
'Read the “', rendererConfig.studiocms?, '” section'| false
| {
autoLinkHeadings
: boolean
;
callouts
: | false
| {
theme
: "github"
| "obsidian"
| "vitepress"
;
};
discordSubtext
: boolean
;
sanitize
: {
allowAttributes
: Record
<string
, …[]>;
allowComments
: boolean
;
allowComponents
: boolean
;
allowCustomElements
: boolean
;
allowElements
: string
[];
blockElements
: string
[];
dropAttributes
: Record
<string
, …[]>;
dropElements
: string
[];
};
} = StudioCMSMarkdownExtendedSchema
Allows customization of the StudioCMS Markdown Extended Configuration
StudioCMS Markdown Extended is a collection of custom markdown features for StudioCMS.
See
https://github.com/withstudiocms/markdown-remark/tree/main^ for more info about StudioCMS Markdown Extended.
| boolean
| {
cacheConfig
: | boolean
| {
lifetime
: string
;
};
} = SDKSchema
SDKSchema is a Zod schema that validates the SDK configuration. It can either be a boolean or an object containing cache configuration.
If it is a boolean, it defaults to true
and transforms into an object
with default cache configuration.
If it is an object, it must contain the cacheConfig
property which is
validated by the SDKCacheSchema
.
boolean
= ...
Whether to show verbose output
Default
false
| undefined
| {
componentRegistry
: Record
<string
, string
>;
dashboardConfig
: {
AuthConfig
: {
enabled
: boolean
;
providers
: {
auth0
: boolean
;
discord
: boolean
;
github
: boolean
;
google
: boolean
;
usernameAndPassword
: boolean
;
usernameAndPasswordConfig
: {
allowUserRegistration
: … | … | …;
};
};
};
dashboardEnabled
: boolean
;
dashboardRouteOverride
: string
;
developerConfig
: {
testingAndDemoMode
: boolean
;
};
faviconURL
: string
;
inject404Route
: boolean
;
versionCheck
: boolean
;
};
dateLocale
: string
;
dateTimeFormat
: DateTimeFormatOptions
;
dbStartPage
: boolean
;
defaultFrontEndConfig
: | boolean
| {
favicon
: string
;
htmlDefaultHead
: {
attrs
: Record
<string
, undefined
| string
| boolean
>;
content
: string
;
tag
: | "title"
| "base"
| "link"
| "style"
| "meta"
| "script"
| "noscript"
| "template"
;
}[];
htmlDefaultLanguage
: string
;
injectQuickActionsMenu
: boolean
;
};
imageService
: {
cdnPlugin
: "cloudinary-js"
;
};
includedIntegrations
: {
robotsTXT
: | boolean
| RobotsConfig
;
};
overrides
: {
CustomImageOverride
: string
;
FormattedDateOverride
: string
;
};
plugins
: StudioCMSPlugin
[];
rendererConfig
: {
markdocConfig
: {
argParse
: {
file
: string
;
location
: boolean
;
slots
: boolean
;
};
renderType
: | "html"
| "react-static"
| MarkdocRenderer
;
transformConfig
: {
functions
: Record
<string
, any
>;
nodes
: Record
<string
, {}>;
partials
: Record
<string
, any
>;
tags
: Record
<string
, {}>;
validation
: {
environment
: … | …;
parents
: … | …;
validateFunctions
: … | … | …;
};
variables
: Record
<string
, any
>;
};
};
mdxConfig
: {
recmaPlugins
: PluggableList
;
rehypePlugins
: PluggableList
;
remarkPlugins
: PluggableList
;
remarkRehypeOptions
: {
allowDangerousHtml
: null
| boolean
;
clobberPrefix
: null
| string
;
file
: any
;
footnoteBackContent
: | null
| string
| (…args
: […, …, ...(...)[]
]) => … | … | … | … | …;
footnoteBackLabel
: null
| string
| (…args
: […, …, ...(...)[]
]) => string
;
footnoteLabel
: null
| string
;
footnoteLabelProperties
: | null
| Record
<string
, … | … | … | … | … | … | …>;
footnoteLabelTagName
: null
| string
;
handlers
: any
;
passThrough
: null
| string
[];
unknownHandler
: any
;
};
};
renderer
: | "studiocms"
| "astro"
| "markdoc"
| "mdx"
| CustomRenderer
;
studiocms
: | false
| {
autoLinkHeadings
: boolean
;
callouts
: | false
| {
theme
: "github"
| "obsidian"
| "vitepress"
;
};
discordSubtext
: boolean
;
sanitize
: {
allowAttributes
: Record
<string
, …[]>;
allowComments
: boolean
;
allowComponents
: boolean
;
allowCustomElements
: boolean
;
allowElements
: string
[];
blockElements
: string
[];
dropAttributes
: Record
<string
, …[]>;
dropElements
: string
[];
};
};
};
sdk
: | boolean
| {
cacheConfig
: | boolean
| {
lifetime
: string
;
};
};
verbose
: boolean
;
}
import { defineStudioCMSConfig } from 'studiocms';
export default defineStudioCMSConfig({ dbStartPage: true, contentRenderer: 'marked', verbose: true, dateLocale: 'en-us', // ...Other Options})
References
'Read the “', References, '” section'CustomRenderer
'Read the “', CustomRenderer, '” section'Re-exports CustomRenderer
Re-exports Renderer
StudioCMSOptions
'Read the “', StudioCMSOptions, '” section'Re-exports StudioCMSOptions