Aller au contenu

Options de StudioCMS

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

studiocms.config.mjs
// Valeurs par défaut affichées
export default
function defineStudioCMSConfig(config: StudioCMSOptions): StudioCMSOptions

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/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
StudioCMSOptions.dbStartPage?: boolean

Project Initialization Page - Used during First Time Setup to initialize the database

@defaulttrue

dbStartPage
: true,
StudioCMSOptions.db?: DBConfigSchema

Database Configuration

db
: {},
StudioCMSOptions.verbose?: boolean

Whether to show verbose output

@defaultfalse

verbose
: false,
StudioCMSOptions.logLevel?: "Info" | "All" | "Fatal" | "Error" | "Warning" | "Debug" | "Trace" | "None"

Set the LogLevel for Effect based code

logLevel
: 'Info',
StudioCMSOptions.plugins?: StudioCMSPlugin[]

Add Plugins to the StudioCMS

plugins
: [],
StudioCMSOptions.componentRegistry?: Record<string, string>

Component Registry

componentRegistry
: {},
StudioCMSOptions.locale?: LocaleConfig

Locale specific settings

locale
: {},
StudioCMSOptions.features?: FeaturesConfig

Allows adjusting the StudioCMS Dashboard features

features
: {}
});

Page d’initialisation du projet - Utilisée lors de la première configuration pour créer votre configuration de base de données.

  • Type : boolean
  • Par défaut : true
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): StudioCMSOptions

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/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
StudioCMSOptions.dbStartPage?: boolean

Project Initialization Page - Used during First Time Setup to initialize the database

@defaulttrue

dbStartPage
: true, // PAR DÉFAUT - Cela injecte une page de démarrage pour configurer vos données de base de données.
})

db est un objet utilisé pour configurer le dialecte de la base de données.

  • Type : DBConfigSchema
  • Par défaut : {}
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): StudioCMSOptions

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/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
StudioCMSOptions.db?: DBConfigSchema

Database Configuration

db
: {
DBConfigSchema.dialect?: "libsql" | "postgres" | "mysql"

Database Dialect to use

@default'libsql'

dialect
: 'libsql', // 'libsql' | 'postgresql' | 'mysql'
},
})

storageManager est utilisé pour configurer le module d’extension de gestion de stockage pour StudioCMS.

  • Type : StudioCMSStorageManager
  • Par défaut : undefined
studiocms.config.mjs
import
function s3Storage(): StudioCMSStorageManager

Creates and configures a StudioCMS S3 Storage Manager plugin.

This function initializes the S3 storage integration for StudioCMS by defining a storage manager plugin with the necessary configuration and hooks.

@returnsA configured storage manager instance that integrates S3 storage capabilities with StudioCMS.

@example

import { studiocmsS3Storage } from '@studiocms/s3-storage';
const s3Storage = studiocmsS3Storage();

s3Storage
from '@studiocms/s3-storage';
export default
function defineStudioCMSConfig(config: StudioCMSOptions): StudioCMSOptions

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/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
StudioCMSOptions.storageManager?: StudioCMSStorageManager

Storage Manager Configuration

storageManager
:
function s3Storage(): StudioCMSStorageManager

Creates and configures a StudioCMS S3 Storage Manager plugin.

This function initializes the S3 storage integration for StudioCMS by defining a storage manager plugin with the necessary configuration and hooks.

@returnsA configured storage manager instance that integrates S3 storage capabilities with StudioCMS.

@example

import { studiocmsS3Storage } from '@studiocms/s3-storage';
const s3Storage = studiocmsS3Storage();

s3Storage
(),
})

verbose est un booléen utilisé pour activer ou désactiver la journalisation détaillée.

  • Type : boolean
  • Par défaut : false
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): StudioCMSOptions

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/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
StudioCMSOptions.verbose?: boolean

Whether to show verbose output

@defaultfalse

verbose
: false, // PAR DÉFAUT - Ceci désactive la journalisation détaillée.
})

logLevel est une union permettant de définir le niveau de journalisation pour le code reposant sur Effect.

  • Type : All | Fatal | Error | Warning | Info | Debug | Trace | None
  • Par défaut : Info
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): StudioCMSOptions

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/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
StudioCMSOptions.logLevel?: "Info" | "All" | "Fatal" | "Error" | "Warning" | "Debug" | "Trace" | "None"

Set the LogLevel for Effect based code

logLevel
: 'Info', // PAR DÉFAUT
})

plugins est un tableau utilisé pour déterminer quels modules d’extension doivent être chargés.

  • Type : StudioCMSPlugin[]
  • Par défaut : []
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): StudioCMSOptions

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/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
StudioCMSOptions.plugins?: StudioCMSPlugin[]

Add Plugins to the StudioCMS

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 est un objet utilisé pour enregistrer des composants.

  • Type : Record<string, string>
  • Par défaut : {}
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): StudioCMSOptions

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/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
StudioCMSOptions.componentRegistry?: Record<string, string>

Component Registry

componentRegistry
: {
'my-component': './src/components/MyComponent.astro',
},
})

locale permet de définir des paramètres spécifiques aux paramètres régionaux

features est un objet qui permet d’ajuster les fonctionnalités du tableau de bord de StudioCMS