Saltearse al contenido

StudioCMSOptions

Referencia del esquema de opciones de configuración de la integración de StudioCMS

studiocms.config.mjs
// Se muestran los valores predeterminados
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.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
dbStartPage?: boolean | undefined
dbStartPage
: true,
dateLocale?: string | undefined
dateLocale
: 'en-us',
verbose?: boolean | undefined
verbose
: false,
plugins?: StudioCMSPlugin[] | undefined
plugins
: [],
componentRegistry?: Record<string, string> | undefined
componentRegistry
: {},
overrides?: {
CustomImageOverride?: string | undefined;
FormattedDateOverride?: string | undefined;
} | undefined
overrides
: {},
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;
nodes?: Record<string, {}> | undefined;
variables?: Record<string, any> | undefined;
functions?: Record<string, any> | undefined;
partials?: Record<string, any> | undefined ...
rendererConfig
: {},
imageService?: {
cdnPlugin?: "cloudinary-js" | undefined;
} | undefined
imageService
: {},
defaultFrontEndConfig?: boolean | {
htmlDefaultLanguage?: string | undefined;
htmlDefaultHead?: {
tag: "base" | "link" | "meta" | "noscript" | "script" | "style" | "template" | "title";
content?: string | undefined;
attrs?: Record<string, string | boolean | undefined> | undefined;
}[] | undefined;
favicon?: string | undefined;
injectQuickActionsMenu?: boolean | undefined;
} | undefined
defaultFrontEndConfig
: {},
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
testingAndDemoMode?: boolean | undefined;
} | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {},
includedIntegrations?: {
robotsTXT?: boolean | RobotsConfig | undefined;
} | undefined
includedIntegrations
: {},
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined
dateTimeFormat
: {},
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined
sdk
: {},
});

Página de inicialización del proyecto - Utilizada durante la configuración inicial para crear la configuración de tu base de datos.

  • Tipo: boolean
  • Valor predeterminado: true
studiocms.config.mjs
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.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
dbStartPage?: boolean | undefined
dbStartPage
: true, // PREDETERMINADO - Esto inyecta una página de inicio para configurar los datos de tu DB.
})

dateLocale es una cadena que se utiliza para determinar la configuración regional para el formato de fecha.

  • Tipo: string
  • Valor predeterminado: 'en-us'
studiocms.config.mjs
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.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
dateLocale?: string | undefined
dateLocale
: 'en-us', // PREDETERMINADO - Esto establece la configuración regional de fecha para el formato de fecha.
})

verbose es un booleano que se utiliza para habilitar o deshabilitar el registro detallado.

  • Tipo: boolean
  • Valor predeterminado: false
studiocms.config.mjs
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.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
verbose?: boolean | undefined
verbose
: false, // PREDETERMINADO - Esto establece el registro detallado en falso.
})

plugins es un array que se utiliza para determinar qué plugins deben cargarse.

  • Tipo: StudioCMSPlugin[]
  • Valor predeterminado: []
studiocms.config.mjs
import
function blog(options?: StudioCMSBlogOptions): StudioCMSPlugin

Creates and configures the StudioCMS Blog plugin.

@paramoptions - Optional configuration options for the blog plugin.

@returnsThe configured StudioCMS plugin.

@example

const blogPlugin = studioCMSBlogPlugin({
blog: {
title: 'My Blog',
enableRSS: true,
route: '/my-blog'
},
sitemap: true,
injectRoutes: true
});

@paramoptions.blog - Blog-specific options.

@paramoptions.blog.title - The title of the blog. Defaults to 'Blog'.

@paramoptions.blog.enableRSS - Whether to enable RSS feed. Defaults to true.

@paramoptions.blog.route - The route for the blog. Defaults to '/blog'.

@paramoptions.sitemap - Whether to trigger sitemap generation. Defaults to true.

@paramoptions.injectRoutes - Whether to inject routes for the blog. Defaults to true.

blog
from '@studiocms/blog';
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.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
plugins?: StudioCMSPlugin[] | undefined
plugins
: [
function blog(options?: StudioCMSBlogOptions): StudioCMSPlugin

Creates and configures the StudioCMS Blog plugin.

@paramoptions - Optional configuration options for the blog plugin.

@returnsThe configured StudioCMS plugin.

@example

const blogPlugin = studioCMSBlogPlugin({
blog: {
title: 'My Blog',
enableRSS: true,
route: '/my-blog'
},
sitemap: true,
injectRoutes: true
});

@paramoptions.blog - Blog-specific options.

@paramoptions.blog.title - The title of the blog. Defaults to 'Blog'.

@paramoptions.blog.enableRSS - Whether to enable RSS feed. Defaults to true.

@paramoptions.blog.route - The route for the blog. Defaults to '/blog'.

@paramoptions.sitemap - Whether to trigger sitemap generation. Defaults to true.

@paramoptions.injectRoutes - Whether to inject routes for the blog. Defaults to true.

blog
(),
],
})

componentRegistry es un objeto que se utiliza para registrar componentes.

  • Tipo: Record<string, string>
  • Valor predeterminado: {}
studiocms.config.mjs
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.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
componentRegistry?: Record<string, string> | undefined
componentRegistry
: {
'my-component': 'src/components/MyComponent.astro',
},
})

dateTimeFormat es un objeto que se utiliza para configurar el formato de fecha y hora.

  • Tipo: Intl.DateTimeFormatOptions
  • Valor predeterminado: {}
studiocms.config.mjs
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.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined
dateTimeFormat
: {
Intl.DateTimeFormatOptions.year?: "numeric" | "2-digit" | undefined
year
: "numeric",
Intl.DateTimeFormatOptions.month?: "numeric" | "2-digit" | "long" | "short" | "narrow" | undefined
month
: "short",
Intl.DateTimeFormatOptions.day?: "numeric" | "2-digit" | undefined
day
: "numeric"
},
})

overrides es un objeto que se utiliza para sobreescribir la configuración predeterminada.

rendererConfig es un objeto que se utiliza para configurar el renderizador.

imageService es un objeto que se utiliza para configurar el servicio de imágenes.

defaultFrontEndConfig es un objeto que se utiliza para configurar el front-end predeterminado.

dashboardConfig es un objeto que se utiliza para configurar el panel de control.

includedIntegrations es un objeto que se utiliza para configurar qué integraciones deben incluirse.

sdk es un objeto que se utiliza para configurar el SDK.