Aller au contenu

Fonctionnalités

Référence du schéma des options de configuration de l’intégration StudioCMS

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {},
});

robotsTXT permet à l’utilisateur d’activer/de désactiver et de configurer l’utilisation de l’intégration personnalisée astro-robots-txt de StudioCMS

  • Type : RobotsConfig | boolean
  • Par défaut : { policy: [ { userAgent: ['*'], allow: ['/'], disallow: ['/dashboard/'] } ] }

Remarque : robotsTXT peut également être défini sur false pour le désactiver.

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
robotsTXT?: boolean | RobotsConfig | undefined
robotsTXT
: {
RobotsConfig.policy?: PolicyOptions[] | undefined

@description [ Optional ] List of policy rules.

@default

policy:[
{
userAgent: "*",
allow: "/"
}
]

For more help, refer to SYNTAX by Yandex.

policy
: [
{
PolicyOptions.userAgent?: UserAgentType | UserAgentType[]

@description [ Required ] Indicates the robot to which the rules listed in robots.txt apply.

@example

policy:[
{
userAgent: [
'Googlebot',
'Applebot',
'Baiduspider',
'bingbot'
],
// crawling rule(s) for above bots
}
]

Verified bots, refer to DITIG or Cloudflare Radar.

userAgent
: ['*'],
PolicyOptions.allow?: string | string[]

@description [ At least one or more allow or disallow entries per rule ] Allows indexing site sections or individual pages.

@example

policy:[{allow:["/"]}]

Path-based URL matching, refer to SYNTAX via Google.

allow
: ['/'],
PolicyOptions.disallow?: string | string[]

@description [ At least one or more disallow or allow entries per rule ] Prohibits indexing site sections or individual pages.

@example

policy:[
{
disallow:[
"/admin",
"/uploads/1989-08-21/*.jpg$"
]
}
]

Path-based URL matching, refer to SYNTAX via Google.

disallow
: ['/dashboard/'],
}
]
}
}
})

injectQuickActionsMenu permet d’activer et de désactiver le menu d’actions rapides qui permet un accès facile à votre tableau de bord lorsque vous êtes connecté sur des pages autres que le tableau de bord.

  • Type : boolean
  • Par défaut : true
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
injectQuickActionsMenu?: boolean | undefined
injectQuickActionsMenu
: true
}
})

sdk peut être soit un booléen, soit un objet contenant la configuration du cache. S’il s’agit d’un booléen, sa valeur par défaut est true et le transforme en objet avec la configuration du cache par défaut.

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined
sdk
: {}
}
})

cacheConfig est un objet utilisé pour configurer le cache du SDK.

  • Type : boolean | { lifetime?: string | undefined; } | undefined
  • Par défaut : { lifetime: '5m' }
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined
sdk
: {
// PAR DÉFAUT - Ceci utilise la configuration de cache par défaut.
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined
cacheConfig
: {
lifetime?: string | undefined
lifetime
: '5m',
},
}
}
})

dashboardConfig permet la personnalisation de la configuration du tableau de bord

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {}
}
})

dashboardEnabled permet à l’utilisateur d’activer ou de désactiver le tableau de bord de StudioCMS tout en fournissant toutes les aides et utilitaires à ceux qui personnalisent leur configuration. Cela désactivera le tableau de bord et vous devrez gérer votre contenu via votre base de données

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
dashboardEnabled?: boolean | undefined
dashboardEnabled
: true,
}
}
})

inject404Route permet à l’utilisateur d’activer ou de désactiver la route 404 par défaut pour le tableau de bord

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
inject404Route?: boolean | undefined
inject404Route
: true,
}
}
})

faviconURL permet à l’utilisateur de remplacer l’URL du favicon par défaut par une URL personnalisée

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
faviconURL?: string | undefined
faviconURL
: '/favicon.svg',
}
}
})

dashboardRouteOverride permet à l’utilisateur de modifier la route de base sur laquelle le tableau de bord est diffusé (par exemple, /admin au lieu de /dashboard)

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
dashboardRouteOverride?: string | undefined
dashboardRouteOverride
: 'dashboard',
}
}
})

versionCheck permet à l’utilisateur d’activer ou de désactiver la vérification de version du tableau de bord.

Cela vérifiera la dernière version de StudioCMS et avertira l’utilisateur si une nouvelle version est disponible.

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
versionCheck?: boolean | undefined
versionCheck
: true,
}
}
})

authConfig permet la personnalisation de la configuration d’authentification

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined
authConfig
: {}
}
})

Permet d’activer ou de désactiver la configuration d’authentification

  • Type : boolean
  • Par défaut : true
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined
authConfig
: {
enabled?: boolean | undefined
enabled
: true
}
}
})

Permet d’activer ou de désactiver les fournisseurs d’authentification

Le fournisseur suivant peut être configuré à partir d’ici : usernameAndPassword.

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined
authConfig
: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined
providers
: {
usernameAndPassword?: boolean | undefined
usernameAndPassword
: true,
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined
usernameAndPasswordConfig
: {
allowUserRegistration?: boolean | undefined
allowUserRegistration
: true
}
}
}
}
})

developerConfig permet la personnalisation des options du développeur

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined
developerConfig
: {}
}
})

Active le mode démo pour le site. Si ce paramètre est défini sur un objet, le site sera en mode démo et l’utilisateur pourra se connecter avec le nom d’utilisateur et le mot de passe fournis.

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined
developerConfig
: {
demoMode?: false | {
password: string;
username: string;
} | undefined
demoMode
: {
username: string
username
: 'foo',
password: string
password
: 'bar'
}
}
}
})

preferredImageService permet de définir l’identifiant du service d’images préféré

Nécessite l’installation d’un service d’image tel que cloudinary-js

  • Type : string | undefined
  • Par défaut : undefined
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
preferredImageService?: string | undefined
preferredImageService
:
var undefined
undefined
}
})