Mise en route
Ce guide a été récemment mis à jour suite aux modifications apportées à StudioCMS v0.1.0. Si vous avez déjà consulté ce guide, veuillez examiner attentivement les modifications afin de vous assurer de disposer des instructions d’installation les plus récentes.
Ou si vous effectuez une mise à niveau depuis une version précédente de StudioCMS, veuillez consulter le guide Mise à niveau de StudioCMS vers la dernière version (EN) pour plus d’informations.
C’est parti
Section intitulée « C’est parti »Pour commencer à utiliser StudioCMS, vous aurez besoin de :
- Une version de Node.js prise en charge par Astro^ (Bun et Deno ne sont pas pris en charge)
- Un projet Astro
- Une connexion à une base de données (libSQL, MySQL ou PostgreSQL)
- L’intégration StudioCMS
Préparer votre base de données
Section intitulée « Préparer votre base de données »Utilisez le code STUDIOCMS10 pour obtenir 10 % de réduction pendant 12 mois sur Turso.
-
Installez la CLI de Turso ^
-
Se connecter ou s'inscrire ^ à Turso.
-
Créer une nouvelle base de données.
Fenêtre de terminal turso db create studiocms -
Obtenez et définissez
CMS_LIBSQL_URL4a. Exécutez la commande
showpour afficher les informations relatives à la base de données nouvellement créée :Fenêtre de terminal turso db show studiocms4b. Copiez la valeur de l’URL et définissez-la comme valeur pour
CMS_LIBSQL_URL..env CMS_LIBSQL_URL=libsql://studiocms-votrenom.turso.io -
Obtenez et définissez
CMS_LIBSQL_AUTH_TOKEN5a. Créez un nouveau jeton pour authentifier les requêtes auprès de la base de données :
Fenêtre de terminal turso db tokens create studiocms5b. Copiez le résultat de la commande et définissez-le comme valeur pour
CMS_LIBSQL_AUTH_TOKEN..env CMS_LIBSQL_AUTH_TOKEN=eyJhbGciOiJF...3ahJpTkKDw
Assurez-vous d’avoir une base de données libSQL configurée et opérationnelle. Vous pouvez utiliser une installation locale, un [conteneur Docker][libsql auto-hébergé] ou un service de base de données géré tel que Turso^.
CMS_LIBSQL_URL=libsql://votre-base-de-donnees.turso.ioCMS_LIBSQL_AUTH_TOKEN=<votre-jeton-authentification> (facultatif)libSQL Assurez-vous d’avoir une base de données MySQL configurée et opérationnelle. Vous pouvez utiliser une installation locale, un conteneur Docker ou un service de base de données géré.
CMS_MYSQL_DATABASE=<nom-de-votre-base-de-donnees>CMS_MYSQL_USER=<utilisateur-de-votre-base-de-donnees>CMS_MYSQL_PASSWORD=<mot-de-passe-de-votre-base-de-donnees>CMS_MYSQL_HOST=<hebergeur-de-votre-base-de-donnees>CMS_MYSQL_PORT=<port-de-votre-base-de-donnees>MySQL Assurez-vous d’avoir une base de données PostgreSQL configurée et opérationnelle. Vous pouvez utiliser une installation locale, un conteneur Docker ou un service de base de données géré.
CMS_PG_DATABASE=<nom-de-votre-base-de-donnees>CMS_PG_USER=<utilisateur-de-votre-base-de-donnees>CMS_PG_PASSWORD=<mot-de-passe-de-votre-base-de-donnees>CMS_PG_HOST=<hebergeur-de-votre-base-de-donnees>CMS_PG_PORT=<port-de-votre-base-de-donnees>PostgreSQL Vous êtes maintenant prêt à passer à la création de votre projet StudioCMS !
Création d’un projet StudioCMS
Section intitulée « Création d’un projet StudioCMS »-
Création d’un projet StudioCMS à l’aide de la commande
createPour créer un nouveau projet Astro avec StudioCMS en utilisant l’un de nos modèles prédéfinis, exécutez simplement la commande suivante dans votre terminal :
Fenêtre de terminal npm create studiocms@latestFenêtre de terminal pnpm create studiocms@latestFenêtre de terminal yarn create studiocmsAprès avoir exécuté la commande, vous serez invité à répondre à quelques questions sur votre projet. Une fois l’opération terminée, l’interface en ligne de commande créera un nouveau projet Astro avec StudioCMS dans le répertoire spécifié.
Ensuite, vous serez invité à effectuer les étapes suivantes, qui consistent notamment à vous assurer que vos variables d’environnement sont correctement définies et à exécuter le projet pour terminer la configuration.
-
Après avoir exécuté la CLI, assurez-vous que votre fichier
astro.config.mjsest correctement configuré :astro.config.mjs import { defineConfig } from 'astro/config';import node from '@astrojs/node';import studioCMS from 'studiocms';export default defineConfig({site: 'https://demo.studiocms.dev/',output: 'server',adapter: node({ mode: "standalone" }),integrations: [studioCMS(),],});
-
Création d’un nouveau projet Astro
Pour créer un nouveau projet Astro, exécutez simplement la commande suivante dans votre terminal :
Fenêtre de terminal npm create astro@latestFenêtre de terminal pnpm create astro@latestFenêtre de terminal yarn create astroAprès avoir exécuté la commande, vous serez invité à répondre à quelques questions sur votre projet. Une fois l’opération terminée, l’interface en ligne de commande créera un nouveau projet Astro dans le répertoire spécifié.
Vous devriez voir le message « Liftoff confirmed. Explore your project! », suivi des prochaines étapes recommandées.
Déplacez-vous (
cd) dans votre nouveau répertoire de projet pour commencer à utiliser Astro.Fenêtre de terminal cd mon-projetSi vous avez ignoré l’étape d’installation de npm pendant l’assistant CLI, veillez à installer vos dépendances avant de continuer.
-
Pour ajouter l’intégration StudioCMS à votre projet, vous devrez installer le paquet StudioCMS et ses dépendances :
Fenêtre de terminal npx astro add node studiocmsFenêtre de terminal pnpm astro add node studiocmsFenêtre de terminal yarn astro add node studiocms -
Après avoir installé le paquet, assurez-vous que votre fichier
astro.config.mjsimporte et appelle correctement l’intégration :astro.config.mjs import { defineConfig } from 'astro/config';import node from '@astrojs/node';import studioCMS from 'studiocms';export default defineConfig({site: 'https://demo.studiocms.dev/',output: 'server',adapter: node({ mode: "standalone" }),integrations: [studioCMS(),],});
-
Création d’un nouveau projet Astro
Pour créer un nouveau projet Astro, exécutez simplement la commande suivante dans votre terminal :
Fenêtre de terminal npm create astro@latestFenêtre de terminal pnpm create astro@latestFenêtre de terminal yarn create astroAprès avoir exécuté la commande, vous serez invité à répondre à quelques questions sur votre projet. Une fois l’opération terminée, l’interface en ligne de commande créera un nouveau projet Astro dans le répertoire spécifié.
Vous devriez voir le message « Liftoff confirmed. Explore your project! », suivi des prochaines étapes recommandées.
Déplacez-vous (
cd) dans votre nouveau répertoire de projet pour commencer à utiliser Astro.Fenêtre de terminal cd mon-projetSi vous avez ignoré l’étape d’installation de npm pendant l’assistant CLI, veillez à installer vos dépendances avant de continuer.
-
Pour ajouter l’intégration StudioCMS à votre projet, vous devrez installer le paquet StudioCMS et ses dépendances :
Fenêtre de terminal npm i @astrojs/node studiocmsFenêtre de terminal pnpm add @astrojs/node studiocmsFenêtre de terminal yarn add @astrojs/node studiocms -
Mettez à jour votre fichier
astro.config.mjs:astro.config.mjs import { defineConfig } from 'astro/config';import node from '@astrojs/node';import studioCMS from 'studiocms';export default defineConfig({site: 'https://demo.studiocms.dev/',output: 'server',adapter: node({ mode: "standalone" }),integrations: [studioCMS(),],});
Veuillez noter que l’option site dans le fichier astro.config.mjs est requise pour que StudioCMS fonctionne correctement. Vous pouvez la définir sur l’URL de votre site ou sur une URL temporaire. (c.-à-d. https://demo.studiocms.dev/ ou http://localhost:4321/)
StudioCMS nécessite un adaptateur Astro^ pour fonctionner correctement. Assurez-vous de définir un adaptateur prenant en charge les routes SSR dans votre fichier astro.config.mjs.
Configurer le dialecte de la base de données de StudioCMS Ajouté dans la version beta.31
Section intitulée « Configurer le dialecte de la base de données de StudioCMS »Si vous utilisez une base de données autre que libSQL, vous devrez configurer l’option db dans votre fichier studiocms.config.mjs pour spécifier le bon dialecte.
export default function defineStudioCMSConfig(config: StudioCMSOptions): { readonly dbStartPage?: boolean | undefined; readonly verbose?: boolean | undefined; readonly logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined; readonly db?: { readonly dialect?: "libsql" | "postgres" | "mysql" | undefined; } | undefined; readonly plugins?: { readonly identifier: string; readonly name: string; readonly studiocmsMinimumVersion?: string | undefined; readonly requires?: readonly string[] | undefined; readonly hooks: { "studiocms:astro-config"?: ((args: { readonly logger: AstroIntegrationLogger; readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>; }) => Promise<void>) | ((args: { readonly logger: AstroIntegrationLogger; readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>; }) => void) | undefined; "studiocms:auth"?: ((args: { readonly logger: AstroIntegrationLogger; readonly setAuthService: (args: { oAuthProvider: { readonly name: string; readonly formattedName: string; readonly svg: string; readonly endpointPath: string; readonly requiredEnvVariables?: readonly string[] | undefined; }; }) => Promise<void>; }) => Promise<void>) | ((args: { readonly logger: AstroIntegrationLogger; readonly setAuthService: (args: { oAuthProvider: { readonly name: string; readonly formattedName: string; readonly svg: string; readonly endpointPath: string; readonly requiredEnvVariables?: readonly string[] | undefined; }; }) => Promise<void>; }) => void) | undefined; "studiocms:dashboard"?: ((args: { readonly logger: AstroIntegrationLogger; readonly setDashboard: (args: { translations: { [x: string]: { [x: string]: { [x: string]: string; }; }; }; dashboardGridItems?: readonly { readonly name: string; readonly span: 1 | 2 | 3; readonly variant: "default" | "filled"; readonly requiresPermission?: "owner" | "admin" | "editor" | "visitor" | undefined; readonly header?: { readonly title: string; readonly icon?: "heroicons:academic-cap" | "heroicons:academic-cap-16-solid" | "heroicons:academic-cap-20-solid" | "heroicons:academic-cap-solid" | "heroicons:adjustments-horizontal" | "heroicons:adjustments-horizontal-16-solid" | "heroicons:adjustments-horizontal-20-solid" | "heroicons:adjustments-horizontal-solid" | "heroicons:adjustments-vertical" | "heroicons:adjustments-vertical-16-solid" | "heroicons:adjustments-vertical-20-solid" | "heroicons:adjustments-vertical-solid" | "heroicons:archive-box" | "heroicons:archive-box-16-solid" | "heroicons:archive-box-20-solid" | "heroicons:archive-box-arrow-down" | "heroicons:archive-box-arrow-down-16-solid" | "heroicons:archive-box-arrow-down-20-solid" | "heroicons:archive-box-arrow-down-solid" | "heroicons:archive-box-solid" | "heroicons:archive-box-x-mark" | "heroicons:archive-box-x-mark-16-solid" | "heroicons:archive-box-x-mark-20-solid" | "heroicons:archive-box-x-mark-solid" | "heroicons:arrow-down" | "heroicons:arrow-down-16-solid" | "heroicons:arrow-down-20-solid" | "heroicons:arrow-down-circle" | "heroicons:arrow-down-circle-16-solid" | "heroicons:arrow-down-circle-20-solid" | "heroicons:arrow-down-circle-solid" | "heroicons:arrow-down-left" | "heroicons:arrow-down-left-16-solid" | "heroicons:arrow-down-left-20-solid" | "heroicons:arrow-down-left-solid" | "heroicons:arrow-down-on-square" | "heroicons:arrow-down-on-square-16-solid" | "heroicons:arrow-down-on-square-20-solid" | "heroicons:arrow-down-on-square-solid" | "heroicons:arrow-down-on-square-stack" | "heroicons:arrow-down-on-square-stack-16-solid" | "heroicons:arrow-down-on-square-stack-20-solid" | "heroicons:arrow-down-on-square-stack-solid" | "heroicons:arrow-down-right" | "heroicons:arrow-down-right-16-solid" | "heroicons:arrow-down-right-20-solid" | "heroicons:arrow-down-right-solid" | "heroicons:arrow-down-solid" | "heroicons:arrow-down-tray" | "heroicons:arrow-down-tray-16-solid" | "heroicons:arrow-down-tray-20-solid" | "heroicons:arrow-down-tray-solid" ...
A utility function to define the StudioCMS config object.
This function is used to define the optional StudioCMS
config object in the Astro project root. The expected file
name is studiocms.config.mjs. And it should be adjacent
to the Astro project's astro.config.mjs file.
StudioCMS will attempt to import this file and use the default
export as the StudioCMS config object automatically if it exists.
Using this function is optional, but it can be useful for IDEs
to provide better intellisense and type checking.
defineStudioCMSConfig({ db?: { readonly dialect?: "libsql" | "postgres" | "mysql" | undefined;} | undefined
db: { dialect?: "libsql" | "postgres" | "mysql" | undefined
dialect: 'postgres', // 'libsql' | 'postgres' | 'mysql' },})S’assurer que les paquets clients de base de données sont installés
Section intitulée « S’assurer que les paquets clients de base de données sont installés »Vous devrez également installer les paquets clients de base de données nécessaires pour le dialecte de base de données que vous avez choisi :
npm i @libsql/client kysely-tursopnpm add @libsql/client kysely-tursoyarn add @libsql/client kysely-tursonpm i mysql2pnpm add mysql2yarn add mysql2npm i pgpnpm add pgyarn add pgConfigurer le rendu de StudioCMS Ajouté dans la beta.22
Section intitulée « Configurer le rendu de StudioCMS »StudioCMS nécessite qu’au moins l’un des modules d’extension de rendu suivants soit installé et configuré dans votre projet StudioCMS :
@studiocms/html- pour le rendu HTML@studiocms/md- pour le rendu Markdown@studiocms/mdx- pour le rendu MDX@studiocms/markdoc- pour le rendu MarkDoc@studiocms/wysiwyg- pour le rendu WYSIWYG- Ou tout autre module d’extension communautaire prenant en charge le rendu de contenu dans StudioCMS.
N’importe lequel de ces modules d’extension peut être utilisé pour afficher du contenu dans StudioCMS. Vous pouvez utiliser un ou plusieurs de ces modules d’extension dans votre projet, selon vos besoins. Ils peuvent être installés et configurés à l’aide du fichier de configuration de StudioCMS.
import { function defineStudioCMSConfig(config: StudioCMSOptions): { readonly dbStartPage?: boolean | undefined; readonly verbose?: boolean | undefined; readonly logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined; readonly db?: { readonly dialect?: "libsql" | "postgres" | "mysql" | undefined; } | undefined; readonly plugins?: { readonly identifier: string; readonly name: string; readonly studiocmsMinimumVersion?: string | undefined; readonly requires?: readonly string[] | undefined; readonly hooks: { "studiocms:astro-config"?: ((args: { readonly logger: AstroIntegrationLogger; readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>; }) => Promise<void>) | ((args: { readonly logger: AstroIntegrationLogger; readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>; }) => void) | undefined; "studiocms:auth"?: ((args: { readonly logger: AstroIntegrationLogger; readonly setAuthService: (args: { oAuthProvider: { readonly name: string; readonly formattedName: string; readonly svg: string; readonly endpointPath: string; readonly requiredEnvVariables?: readonly string[] | undefined; }; }) => Promise<void>; }) => Promise<void>) | ((args: { readonly logger: AstroIntegrationLogger; readonly setAuthService: (args: { oAuthProvider: { readonly name: string; readonly formattedName: string; readonly svg: string; readonly endpointPath: string; readonly requiredEnvVariables?: readonly string[] | undefined; }; }) => Promise<void>; }) => void) | undefined; "studiocms:dashboard"?: ((args: { readonly logger: AstroIntegrationLogger; readonly setDashboard: (args: { translations: { [x: string]: { [x: string]: { [x: string]: string; }; }; }; dashboardGridItems?: readonly { readonly name: string; readonly span: 1 | 2 | 3; readonly variant: "default" | "filled"; readonly requiresPermission?: "owner" | "admin" | "editor" | "visitor" | undefined; readonly header?: { readonly title: string; readonly icon?: "heroicons:academic-cap" | "heroicons:academic-cap-16-solid" | "heroicons:academic-cap-20-solid" | "heroicons:academic-cap-solid" | "heroicons:adjustments-horizontal" | "heroicons:adjustments-horizontal-16-solid" | "heroicons:adjustments-horizontal-20-solid" | "heroicons:adjustments-horizontal-solid" | "heroicons:adjustments-vertical" | "heroicons:adjustments-vertical-16-solid" | "heroicons:adjustments-vertical-20-solid" | "heroicons:adjustments-vertical-solid" | "heroicons:archive-box" | "heroicons:archive-box-16-solid" | "heroicons:archive-box-20-solid" | "heroicons:archive-box-arrow-down" | "heroicons:archive-box-arrow-down-16-solid" | "heroicons:archive-box-arrow-down-20-solid" | "heroicons:archive-box-arrow-down-solid" | "heroicons:archive-box-solid" | "heroicons:archive-box-x-mark" | "heroicons:archive-box-x-mark-16-solid" | "heroicons:archive-box-x-mark-20-solid" | "heroicons:archive-box-x-mark-solid" | "heroicons:arrow-down" | "heroicons:arrow-down-16-solid" | "heroicons:arrow-down-20-solid" | "heroicons:arrow-down-circle" | "heroicons:arrow-down-circle-16-solid" | "heroicons:arrow-down-circle-20-solid" | "heroicons:arrow-down-circle-solid" | "heroicons:arrow-down-left" | "heroicons:arrow-down-left-16-solid" | "heroicons:arrow-down-left-20-solid" | "heroicons:arrow-down-left-solid" | "heroicons:arrow-down-on-square" | "heroicons:arrow-down-on-square-16-solid" | "heroicons:arrow-down-on-square-20-solid" | "heroicons:arrow-down-on-square-solid" | "heroicons:arrow-down-on-square-stack" | "heroicons:arrow-down-on-square-stack-16-solid" | "heroicons:arrow-down-on-square-stack-20-solid" | "heroicons:arrow-down-on-square-stack-solid" | "heroicons:arrow-down-right" | "heroicons:arrow-down-right-16-solid" | "heroicons:arrow-down-right-20-solid" | "heroicons:arrow-down-right-solid" | "heroicons:arrow-down-solid" | "heroicons:arrow-down-tray" | "heroicons:arrow-down-tray-16-solid" | "heroicons:arrow-down-tray-20-solid" | "heroicons:arrow-down-tray-solid" ...
A utility function to define the StudioCMS config object.
This function is used to define the optional StudioCMS
config object in the Astro project root. The expected file
name is studiocms.config.mjs. And it should be adjacent
to the Astro project's astro.config.mjs file.
StudioCMS will attempt to import this file and use the default
export as the StudioCMS config object automatically if it exists.
Using this function is optional, but it can be useful for IDEs
to provide better intellisense and type checking.
defineStudioCMSConfig } from 'studiocms/config';import function html(options?: HTMLSchemaOptions): StudioCMSPluginDef
Creates the StudioCMS HTML plugin.
This plugin integrates HTML page type support into StudioCMS, providing editor and renderer components.
It resolves configuration options, sets up Astro integrations, and registers the HTML page type for rendering.
html from '@studiocms/html';import function md(options?: MarkdownSchemaOptions): StudioCMSPluginDef
Creates a StudioCMS plugin for Markdown page types.
This plugin configures StudioCMS to support Markdown content, including rendering and editing components,
integration with Astro, and optional callout themes. It resolves user-provided options, sets up virtual imports,
and injects necessary styles and scripts for Markdown rendering.
md from '@studiocms/md';
export default function defineStudioCMSConfig(config: StudioCMSOptions): { readonly dbStartPage?: boolean | undefined; readonly verbose?: boolean | undefined; readonly logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined; readonly db?: { readonly dialect?: "libsql" | "postgres" | "mysql" | undefined; } | undefined; readonly plugins?: { readonly identifier: string; readonly name: string; readonly studiocmsMinimumVersion?: string | undefined; readonly requires?: readonly string[] | undefined; readonly hooks: { "studiocms:astro-config"?: ((args: { readonly logger: AstroIntegrationLogger; readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>; }) => Promise<void>) | ((args: { readonly logger: AstroIntegrationLogger; readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>; }) => void) | undefined; "studiocms:auth"?: ((args: { readonly logger: AstroIntegrationLogger; readonly setAuthService: (args: { oAuthProvider: { readonly name: string; readonly formattedName: string; readonly svg: string; readonly endpointPath: string; readonly requiredEnvVariables?: readonly string[] | undefined; }; }) => Promise<void>; }) => Promise<void>) | ((args: { readonly logger: AstroIntegrationLogger; readonly setAuthService: (args: { oAuthProvider: { readonly name: string; readonly formattedName: string; readonly svg: string; readonly endpointPath: string; readonly requiredEnvVariables?: readonly string[] | undefined; }; }) => Promise<void>; }) => void) | undefined; "studiocms:dashboard"?: ((args: { readonly logger: AstroIntegrationLogger; readonly setDashboard: (args: { translations: { [x: string]: { [x: string]: { [x: string]: string; }; }; }; dashboardGridItems?: readonly { readonly name: string; readonly span: 1 | 2 | 3; readonly variant: "default" | "filled"; readonly requiresPermission?: "owner" | "admin" | "editor" | "visitor" | undefined; readonly header?: { readonly title: string; readonly icon?: "heroicons:academic-cap" | "heroicons:academic-cap-16-solid" | "heroicons:academic-cap-20-solid" | "heroicons:academic-cap-solid" | "heroicons:adjustments-horizontal" | "heroicons:adjustments-horizontal-16-solid" | "heroicons:adjustments-horizontal-20-solid" | "heroicons:adjustments-horizontal-solid" | "heroicons:adjustments-vertical" | "heroicons:adjustments-vertical-16-solid" | "heroicons:adjustments-vertical-20-solid" | "heroicons:adjustments-vertical-solid" | "heroicons:archive-box" | "heroicons:archive-box-16-solid" | "heroicons:archive-box-20-solid" | "heroicons:archive-box-arrow-down" | "heroicons:archive-box-arrow-down-16-solid" | "heroicons:archive-box-arrow-down-20-solid" | "heroicons:archive-box-arrow-down-solid" | "heroicons:archive-box-solid" | "heroicons:archive-box-x-mark" | "heroicons:archive-box-x-mark-16-solid" | "heroicons:archive-box-x-mark-20-solid" | "heroicons:archive-box-x-mark-solid" | "heroicons:arrow-down" | "heroicons:arrow-down-16-solid" | "heroicons:arrow-down-20-solid" | "heroicons:arrow-down-circle" | "heroicons:arrow-down-circle-16-solid" | "heroicons:arrow-down-circle-20-solid" | "heroicons:arrow-down-circle-solid" | "heroicons:arrow-down-left" | "heroicons:arrow-down-left-16-solid" | "heroicons:arrow-down-left-20-solid" | "heroicons:arrow-down-left-solid" | "heroicons:arrow-down-on-square" | "heroicons:arrow-down-on-square-16-solid" | "heroicons:arrow-down-on-square-20-solid" | "heroicons:arrow-down-on-square-solid" | "heroicons:arrow-down-on-square-stack" | "heroicons:arrow-down-on-square-stack-16-solid" | "heroicons:arrow-down-on-square-stack-20-solid" | "heroicons:arrow-down-on-square-stack-solid" | "heroicons:arrow-down-right" | "heroicons:arrow-down-right-16-solid" | "heroicons:arrow-down-right-20-solid" | "heroicons:arrow-down-right-solid" | "heroicons:arrow-down-solid" | "heroicons:arrow-down-tray" | "heroicons:arrow-down-tray-16-solid" | "heroicons:arrow-down-tray-20-solid" | "heroicons:arrow-down-tray-solid" ...
A utility function to define the StudioCMS config object.
This function is used to define the optional StudioCMS
config object in the Astro project root. The expected file
name is studiocms.config.mjs. And it should be adjacent
to the Astro project's astro.config.mjs file.
StudioCMS will attempt to import this file and use the default
export as the StudioCMS config object automatically if it exists.
Using this function is optional, but it can be useful for IDEs
to provide better intellisense and type checking.
defineStudioCMSConfig({ plugins?: { readonly identifier: string; readonly name: string; readonly studiocmsMinimumVersion?: string | undefined | undefined; readonly requires?: readonly string[] | undefined; readonly hooks: { "studiocms:astro-config"?: ((args: { readonly logger: AstroIntegrationLogger; readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>; }) => Promise<void>) | ((args: { readonly logger: AstroIntegrationLogger; readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>; }) => void) | undefined; "studiocms:auth"?: ((args: { readonly logger: AstroIntegrationLogger; readonly setAuthService: (args: { oAuthProvider: { readonly name: string; readonly formattedName: string; readonly svg: string; readonly endpointPath: string; readonly requiredEnvVariables?: readonly string[] | undefined; }; }) => Promise<void>; }) => Promise<void>) | ((args: { readonly logger: AstroIntegrationLogger; readonly setAuthService: (args: { oAuthProvider: { readonly name: string; readonly formattedName: string; readonly svg: string; readonly endpointPath: string; readonly requiredEnvVariables?: readonly string[] | undefined; }; }) => Promise<void>; }) => void) | undefined; "studiocms:dashboard"?: ((args: { readonly logger: AstroIntegrationLogger; readonly setDashboard: (args: { translations: { [x: string]: { [x: string]: { [x: string]: string; }; }; }; dashboardGridItems?: readonly { readonly name: string; readonly span: 1 | 2 | 3; readonly variant: "default" | "filled"; readonly requiresPermission?: "owner" | "admin" | "editor" | "visitor" | undefined; readonly header?: { readonly title: string; readonly icon?: "heroicons:academic-cap" | "heroicons:academic-cap-16-solid" | "heroicons:academic-cap-20-solid" | "heroicons:academic-cap-solid" | "heroicons:adjustments-horizontal" | "heroicons:adjustments-horizontal-16-solid" | "heroicons:adjustments-horizontal-20-solid" | "heroicons:adjustments-horizontal-solid" | "heroicons:adjustments-vertical" | "heroicons:adjustments-vertical-16-solid" | "heroicons:adjustments-vertical-20-solid" | "heroicons:adjustments-vertical-solid" | "heroicons:archive-box" | "heroicons:archive-box-16-solid" | "heroicons:archive-box-20-solid" | "heroicons:archive-box-arrow-down" | "heroicons:archive-box-arrow-down-16-solid" | "heroicons:archive-box-arrow-down-20-solid" | "heroicons:archive-box-arrow-down-solid" | "heroicons:archive-box-solid" | "heroicons:archive-box-x-mark" | "heroicons:archive-box-x-mark-16-solid" | "heroicons:archive-box-x-mark-20-solid" | "heroicons:archive-box-x-mark-solid" | "heroicons:arrow-down" | "heroicons:arrow-down-16-solid" | "heroicons:arrow-down-20-solid" | "heroicons:arrow-down-circle" | "heroicons:arrow-down-circle-16-solid" | "heroicons:arrow-down-circle-20-solid" | "heroicons:arrow-down-circle-solid" | "heroicons:arrow-down-left" | "heroicons:arrow-down-left-16-solid" | "heroicons:arrow-down-left-20-solid" | "heroicons:arrow-down-left-solid" | "heroicons:arrow-down-on-square" | "heroicons:arrow-down-on-square-16-solid" | "heroicons:arrow-down-on-square-20-solid" | "heroicons:arrow-down-on-square-solid" | "heroicons:arrow-down-on-square-stack" | "heroicons:arrow-down-on-square-stack-16-solid" | "heroicons:arrow-down-on-square-stack-20-solid" | "heroicons:arrow-down-on-square-stack-solid" | "heroicons:arrow-down-right" | "heroicons:arrow-down-right-16-solid" | "heroicons:arrow-down-right-20-solid" | "heroicons:arrow-down-right-solid" | "heroicons:arrow-down-solid" | "heroicons:arrow-down-tray" | "heroicons:arrow-down-tray-16-solid" | "heroicons:arrow-down-tray-20-solid" | "heroicons:arrow-down-tray-solid" | "heroicons:arrow-left" | "heroicons:arrow-left-16-solid" | "heroicons:arrow-left-20-solid" | "heroicons:arrow-left-circle" | "heroicons:arrow-left-circle-16-solid" | "heroicons:arrow-left-circle-20-solid" | "heroicons:arrow-left-circle-solid" | "heroicons:arrow-left-end-on-rectangle" | "heroicons:arrow-left-end-on-rectangle-16-solid" | "heroicons:arrow-left-end-on-rectangle-20-solid" | "heroicons:arrow-left-end-on-rectangle-solid" | "heroicons:arrow-left-on-rectangle" | "heroicons:arrow-left-on-rectangle-20-solid" | "heroicons:arrow-left-on-rectangle-solid" ...
plugins: [ function html(options?: HTMLSchemaOptions): StudioCMSPluginDef
Creates the StudioCMS HTML plugin.
This plugin integrates HTML page type support into StudioCMS, providing editor and renderer components.
It resolves configuration options, sets up Astro integrations, and registers the HTML page type for rendering.
html(), function md(options?: MarkdownSchemaOptions): StudioCMSPluginDef
Creates a StudioCMS plugin for Markdown page types.
This plugin configures StudioCMS to support Markdown content, including rendering and editing components,
integration with Astro, and optional callout themes. It resolves user-provided options, sets up virtual imports,
and injects necessary styles and scripts for Markdown rendering.
md(), ],});Configurer l’authentification
Section intitulée « Configurer l’authentification »L’authentification intégrée de StudioCMS nécessite au moins que la clé de chiffrement soit définie dans votre fichier .env.
Les variables d’environnement suivantes sont requises pour l’authentification StudioCMS :
# clé de chiffrement pour l’authentification par nom d’utilisateur et mot de passeCMS_ENCRYPTION_KEY="wqR+w...sRcg=="Vous pouvez générer une clé de chiffrement sécurisée à l’aide de la commande suivante :
openssl rand --base64 16Et utiliser la sortie comme valeur pour CMS_ENCRYPTION_KEY.
Pour plus d’informations sur toutes les variables d’environnement d’authentification disponibles, consultez la page Variables d’environnement.
Facultatif : configurer l’authentification oAuth Révisé dans la bêta.23
Section intitulée « Facultatif : configurer l’authentification oAuth »StudioCMS prend en charge divers fournisseurs d’authentification oAuth, en utilisant notre système de modules d’extension pour activer les fournisseurs que vous souhaitez utiliser. Pour commencer, vous devrez trouver un module d’extension pour le fournisseur que vous souhaitez utiliser ou créer votre propre module d’extension.
Pour configurer les fournisseurs oAuth, une URL de rappel est nécessaire. Cette URL correspond au chemin vers lequel le fournisseur redirigera l’utilisateur après l’authentification.
Configuration de l’URL de rappel
Section intitulée « Configuration de l’URL de rappel »L’URL de rappel doit être définie sur l’un des chemins suivants en fonction de votre environnement :
| Environnement | URL de rappel |
|---|---|
| Production | https://votre-domaine.tld/studiocms_api/auth/<provider>/callback |
| Tests & Dev | http://localhost:4321/studiocms_api/auth/<provider>/callback |
Exemples de chemins d’URL de rappel
Section intitulée « Exemples de chemins d’URL de rappel »Les chemins suivants sont des exemples d’URL de rappel pour chaque fournisseur :
| Fournisseur | Chemin de rappel |
|---|---|
| GitHub | /studiocms_api/auth/github/callback |
| Discord | /studiocms_api/auth/discord/callback |
/studiocms_api/auth/google/callback | |
| Auth0 | /studiocms_api/auth/auth0/callback |
Configurer le gestionnaire d’API de stockage (facultatif) Ajouté dans la v0.1.0
Section intitulée « Configurer le gestionnaire d’API de stockage (facultatif) »StudioCMS prend en charge l’utilisation de différents gestionnaires d’API de stockage pour gérer le stockage des fichiers et des images. Par défaut, StudioCMS utilise un gestionnaire de stockage intégré qui ne stocke aucun fichier ni image.
Pour configurer un autre gestionnaire d’API de stockage, vous devrez installer le module d’extension approprié et le configurer dans votre fichier studiocms.config.mjs.
Exemple : Configurer le gestionnaire de stockage S3
Section intitulée « Exemple : Configurer le gestionnaire de stockage S3 »-
Installez le module d’extension
@studiocms/s3-storage:Fenêtre de terminal npm i @studiocms/s3-storageFenêtre de terminal pnpm add @studiocms/s3-storageFenêtre de terminal yarn add @studiocms/s3-storage -
Mettez à jour votre fichier
studiocms.config.mjspour utiliser le gestionnaire de stockage S3 :studiocms.config.mjs import { defineStudioCMSConfig } from 'studiocms/config';import s3Storage from '@studiocms/s3-storage';export default defineStudioCMSConfig({storageManager: s3Storage(),}); -
Définissez les variables d’environnement requises pour le gestionnaire de stockage S3 dans votre fichier
.env:Le gestionnaire de stockage S3 de StudioCMS est construit à l’aide du paquet
@aws-sdk/client-s3, qui prend en charge tout fournisseur de stockage compatible S3, y compris AWS S3, DigitalOcean Spaces, MinIO et autres..env CMS_S3_PROVIDER=ExempleDeFournisseurS3CMS_S3_ACCESS_KEY_ID=<id-de-votre-clé-d-accès>CMS_S3_SECRET_ACCESS_KEY=<votre-clé-d-accès-secrète>CMS_S3_BUCKET_NAME=<nom-de-votre-seau># CMS_S3_ENDPOINT= # Facultatif : Spécifiez un point de terminaison personnalisé si votre fournisseur l’exige.# CMS_S3_REGION= # Facultatif : Indiquez la région si votre fournisseur l’exige.# CMS_S3_FORCE_PATH_STYLE= # Facultatif : utiliser des URL de type chemin pour les objets S3# CMS_S3_PUBLIC_ENDPOINT= # Facultatif : point de terminaison public personnalisé pour accéder aux fichiersPour plus d’informations sur les variables d’environnement avec le gestionnaire de stockage S3, consultez Stockage S3 : Variables d’environnement
Configurer les scripts de votre package.json
Section intitulée « Configurer les scripts de votre package.json »Configurez les scripts de votre fichier package.json pour inclure les commandes StudioCMS suivantes afin de faciliter leur utilisation :
{ "name": "mon-projet-studiocms", "scripts": { "dev": "astro dev", "build": "astro check & astro build", "astro": "astro", "migrate": "studiocms migrate", "studiocms": "studiocms", }}Exécution de votre projet StudioCMS
Section intitulée « Exécution de votre projet StudioCMS »Grâce à la puissance d’Astro, exécuter StudioCMS est aussi simple que d’exécuter la commande dev pour obtenir un aperçu local, ou de créer et de déployer sur votre serveur. Pour une utilisation locale de base sans construction, voici ce que vous devez faire.
Première configuration (ou lors des mises à jour si le schéma des tables est mis à jour)
Section intitulée « Première configuration (ou lors des mises à jour si le schéma des tables est mis à jour) »Pour démarrer votre projet Astro, exécutez les commandes suivantes dans votre terminal :
npm run studiocms migrate --latestpnpm run studiocms migrate --latestyarn run studiocms migrate --latestnpm run devpnpm run devyarn run devAprès avoir exécuté les commandes, un message devrait s’afficher indiquant que votre projet s’exécute sur localhost:4321. Lors de la première configuration de StudioCMS, vous serez invité à terminer la configuration à l’adresse http://localhost:4321/start.
Exécution locale avec le mode développement d’Astro
Section intitulée « Exécution locale avec le mode développement d’Astro »Pour démarrer votre projet Astro, exécutez la commande suivante dans votre terminal :
npm run devpnpm run devyarn run devAprès avoir exécuté la commande, vous devriez voir un message indiquant que votre projet s’exécute sur localhost:4321. Ouvrez votre navigateur et accédez à http://localhost:4321 pour voir votre projet Astro en action.
Vous pouvez accéder par défaut au tableau de bord de StudioCMS à l’adresse http://localhost:4321/dashboard pour gérer votre contenu et vos paramètres.
Félicitations ! 🥳 Vous avez maintenant installé StudioCMS dans votre projet Astro.
Ajouter un frontend à votre projet StudioCMS
Section intitulée « Ajouter un frontend à votre projet StudioCMS »StudioCMS est un CMS headless pour Astro, ce qui signifie que vous devez fournir votre propre frontend pour afficher le contenu. Si vous recherchez un frontend prêt à l’emploi, vous pouvez consulter nos modules d’extension dans le Catalogue de paquets.
Créer un blog
Section intitulée « Créer un blog »Par exemple, si vous souhaitez créer un blog à l’aide de StudioCMS, vous pouvez utiliser le module d’extension @studiocms/blog pour démarrer rapidement sans avoir à tout créer à partir de zéro. Ce module d’extension fournit une interface de blog simple qui élimine le besoin d’avoir des fichiers sources pour vos pages frontend.
Pour installer et configurer le module d’extension de blog, exécutez la commande suivante dans votre terminal :
npm install @studiocms/blogpnpm install @studiocms/blogyarn install @studiocms/blogAprès avoir installé le module d’extension, vous devrez l’ajouter dans votre fichier studiocms.config.mjs :
import { function defineStudioCMSConfig(config: StudioCMSOptions): { readonly dbStartPage?: boolean | undefined; readonly verbose?: boolean | undefined; readonly logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined; readonly db?: { readonly dialect?: "libsql" | "postgres" | "mysql" | undefined; } | undefined; readonly plugins?: { readonly identifier: string; readonly name: string; readonly studiocmsMinimumVersion?: string | undefined; readonly requires?: readonly string[] | undefined; readonly hooks: { "studiocms:astro-config"?: ((args: { readonly logger: AstroIntegrationLogger; readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>; }) => Promise<void>) | ((args: { readonly logger: AstroIntegrationLogger; readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>; }) => void) | undefined; "studiocms:auth"?: ((args: { readonly logger: AstroIntegrationLogger; readonly setAuthService: (args: { oAuthProvider: { readonly name: string; readonly formattedName: string; readonly svg: string; readonly endpointPath: string; readonly requiredEnvVariables?: readonly string[] | undefined; }; }) => Promise<void>; }) => Promise<void>) | ((args: { readonly logger: AstroIntegrationLogger; readonly setAuthService: (args: { oAuthProvider: { readonly name: string; readonly formattedName: string; readonly svg: string; readonly endpointPath: string; readonly requiredEnvVariables?: readonly string[] | undefined; }; }) => Promise<void>; }) => void) | undefined; "studiocms:dashboard"?: ((args: { readonly logger: AstroIntegrationLogger; readonly setDashboard: (args: { translations: { [x: string]: { [x: string]: { [x: string]: string; }; }; }; dashboardGridItems?: readonly { readonly name: string; readonly span: 1 | 2 | 3; readonly variant: "default" | "filled"; readonly requiresPermission?: "owner" | "admin" | "editor" | "visitor" | undefined; readonly header?: { readonly title: string; readonly icon?: "heroicons:academic-cap" | "heroicons:academic-cap-16-solid" | "heroicons:academic-cap-20-solid" | "heroicons:academic-cap-solid" | "heroicons:adjustments-horizontal" | "heroicons:adjustments-horizontal-16-solid" | "heroicons:adjustments-horizontal-20-solid" | "heroicons:adjustments-horizontal-solid" | "heroicons:adjustments-vertical" | "heroicons:adjustments-vertical-16-solid" | "heroicons:adjustments-vertical-20-solid" | "heroicons:adjustments-vertical-solid" | "heroicons:archive-box" | "heroicons:archive-box-16-solid" | "heroicons:archive-box-20-solid" | "heroicons:archive-box-arrow-down" | "heroicons:archive-box-arrow-down-16-solid" | "heroicons:archive-box-arrow-down-20-solid" | "heroicons:archive-box-arrow-down-solid" | "heroicons:archive-box-solid" | "heroicons:archive-box-x-mark" | "heroicons:archive-box-x-mark-16-solid" | "heroicons:archive-box-x-mark-20-solid" | "heroicons:archive-box-x-mark-solid" | "heroicons:arrow-down" | "heroicons:arrow-down-16-solid" | "heroicons:arrow-down-20-solid" | "heroicons:arrow-down-circle" | "heroicons:arrow-down-circle-16-solid" | "heroicons:arrow-down-circle-20-solid" | "heroicons:arrow-down-circle-solid" | "heroicons:arrow-down-left" | "heroicons:arrow-down-left-16-solid" | "heroicons:arrow-down-left-20-solid" | "heroicons:arrow-down-left-solid" | "heroicons:arrow-down-on-square" | "heroicons:arrow-down-on-square-16-solid" | "heroicons:arrow-down-on-square-20-solid" | "heroicons:arrow-down-on-square-solid" | "heroicons:arrow-down-on-square-stack" | "heroicons:arrow-down-on-square-stack-16-solid" | "heroicons:arrow-down-on-square-stack-20-solid" | "heroicons:arrow-down-on-square-stack-solid" | "heroicons:arrow-down-right" | "heroicons:arrow-down-right-16-solid" | "heroicons:arrow-down-right-20-solid" | "heroicons:arrow-down-right-solid" | "heroicons:arrow-down-solid" | "heroicons:arrow-down-tray" | "heroicons:arrow-down-tray-16-solid" | "heroicons:arrow-down-tray-20-solid" | "heroicons:arrow-down-tray-solid" ...
A utility function to define the StudioCMS config object.
This function is used to define the optional StudioCMS
config object in the Astro project root. The expected file
name is studiocms.config.mjs. And it should be adjacent
to the Astro project's astro.config.mjs file.
StudioCMS will attempt to import this file and use the default
export as the StudioCMS config object automatically if it exists.
Using this function is optional, but it can be useful for IDEs
to provide better intellisense and type checking.
defineStudioCMSConfig } from 'studiocms/config';import function blog(options?: StudioCMSBlogOptions): StudioCMSPluginDef
Creates and configures the StudioCMS Blog plugin.
blog from '@studiocms/blog';
export default function defineStudioCMSConfig(config: StudioCMSOptions): { readonly dbStartPage?: boolean | undefined; readonly verbose?: boolean | undefined; readonly logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined; readonly db?: { readonly dialect?: "libsql" | "postgres" | "mysql" | undefined; } | undefined; readonly plugins?: { readonly identifier: string; readonly name: string; readonly studiocmsMinimumVersion?: string | undefined; readonly requires?: readonly string[] | undefined; readonly hooks: { "studiocms:astro-config"?: ((args: { readonly logger: AstroIntegrationLogger; readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>; }) => Promise<void>) | ((args: { readonly logger: AstroIntegrationLogger; readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>; }) => void) | undefined; "studiocms:auth"?: ((args: { readonly logger: AstroIntegrationLogger; readonly setAuthService: (args: { oAuthProvider: { readonly name: string; readonly formattedName: string; readonly svg: string; readonly endpointPath: string; readonly requiredEnvVariables?: readonly string[] | undefined; }; }) => Promise<void>; }) => Promise<void>) | ((args: { readonly logger: AstroIntegrationLogger; readonly setAuthService: (args: { oAuthProvider: { readonly name: string; readonly formattedName: string; readonly svg: string; readonly endpointPath: string; readonly requiredEnvVariables?: readonly string[] | undefined; }; }) => Promise<void>; }) => void) | undefined; "studiocms:dashboard"?: ((args: { readonly logger: AstroIntegrationLogger; readonly setDashboard: (args: { translations: { [x: string]: { [x: string]: { [x: string]: string; }; }; }; dashboardGridItems?: readonly { readonly name: string; readonly span: 1 | 2 | 3; readonly variant: "default" | "filled"; readonly requiresPermission?: "owner" | "admin" | "editor" | "visitor" | undefined; readonly header?: { readonly title: string; readonly icon?: "heroicons:academic-cap" | "heroicons:academic-cap-16-solid" | "heroicons:academic-cap-20-solid" | "heroicons:academic-cap-solid" | "heroicons:adjustments-horizontal" | "heroicons:adjustments-horizontal-16-solid" | "heroicons:adjustments-horizontal-20-solid" | "heroicons:adjustments-horizontal-solid" | "heroicons:adjustments-vertical" | "heroicons:adjustments-vertical-16-solid" | "heroicons:adjustments-vertical-20-solid" | "heroicons:adjustments-vertical-solid" | "heroicons:archive-box" | "heroicons:archive-box-16-solid" | "heroicons:archive-box-20-solid" | "heroicons:archive-box-arrow-down" | "heroicons:archive-box-arrow-down-16-solid" | "heroicons:archive-box-arrow-down-20-solid" | "heroicons:archive-box-arrow-down-solid" | "heroicons:archive-box-solid" | "heroicons:archive-box-x-mark" | "heroicons:archive-box-x-mark-16-solid" | "heroicons:archive-box-x-mark-20-solid" | "heroicons:archive-box-x-mark-solid" | "heroicons:arrow-down" | "heroicons:arrow-down-16-solid" | "heroicons:arrow-down-20-solid" | "heroicons:arrow-down-circle" | "heroicons:arrow-down-circle-16-solid" | "heroicons:arrow-down-circle-20-solid" | "heroicons:arrow-down-circle-solid" | "heroicons:arrow-down-left" | "heroicons:arrow-down-left-16-solid" | "heroicons:arrow-down-left-20-solid" | "heroicons:arrow-down-left-solid" | "heroicons:arrow-down-on-square" | "heroicons:arrow-down-on-square-16-solid" | "heroicons:arrow-down-on-square-20-solid" | "heroicons:arrow-down-on-square-solid" | "heroicons:arrow-down-on-square-stack" | "heroicons:arrow-down-on-square-stack-16-solid" | "heroicons:arrow-down-on-square-stack-20-solid" | "heroicons:arrow-down-on-square-stack-solid" | "heroicons:arrow-down-right" | "heroicons:arrow-down-right-16-solid" | "heroicons:arrow-down-right-20-solid" | "heroicons:arrow-down-right-solid" | "heroicons:arrow-down-solid" | "heroicons:arrow-down-tray" | "heroicons:arrow-down-tray-16-solid" | "heroicons:arrow-down-tray-20-solid" | "heroicons:arrow-down-tray-solid" ...
A utility function to define the StudioCMS config object.
This function is used to define the optional StudioCMS
config object in the Astro project root. The expected file
name is studiocms.config.mjs. And it should be adjacent
to the Astro project's astro.config.mjs file.
StudioCMS will attempt to import this file and use the default
export as the StudioCMS config object automatically if it exists.
Using this function is optional, but it can be useful for IDEs
to provide better intellisense and type checking.
defineStudioCMSConfig({ dbStartPage?: boolean | undefined
dbStartPage: false, plugins?: { readonly identifier: string; readonly name: string; readonly studiocmsMinimumVersion?: string | undefined | undefined; readonly requires?: readonly string[] | undefined; readonly hooks: { "studiocms:astro-config"?: ((args: { readonly logger: AstroIntegrationLogger; readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>; }) => Promise<void>) | ((args: { readonly logger: AstroIntegrationLogger; readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>; }) => void) | undefined; "studiocms:auth"?: ((args: { readonly logger: AstroIntegrationLogger; readonly setAuthService: (args: { oAuthProvider: { readonly name: string; readonly formattedName: string; readonly svg: string; readonly endpointPath: string; readonly requiredEnvVariables?: readonly string[] | undefined; }; }) => Promise<void>; }) => Promise<void>) | ((args: { readonly logger: AstroIntegrationLogger; readonly setAuthService: (args: { oAuthProvider: { readonly name: string; readonly formattedName: string; readonly svg: string; readonly endpointPath: string; readonly requiredEnvVariables?: readonly string[] | undefined; }; }) => Promise<void>; }) => void) | undefined; "studiocms:dashboard"?: ((args: { readonly logger: AstroIntegrationLogger; readonly setDashboard: (args: { translations: { [x: string]: { [x: string]: { [x: string]: string; }; }; }; dashboardGridItems?: readonly { readonly name: string; readonly span: 1 | 2 | 3; readonly variant: "default" | "filled"; readonly requiresPermission?: "owner" | "admin" | "editor" | "visitor" | undefined; readonly header?: { readonly title: string; readonly icon?: "heroicons:academic-cap" | "heroicons:academic-cap-16-solid" | "heroicons:academic-cap-20-solid" | "heroicons:academic-cap-solid" | "heroicons:adjustments-horizontal" | "heroicons:adjustments-horizontal-16-solid" | "heroicons:adjustments-horizontal-20-solid" | "heroicons:adjustments-horizontal-solid" | "heroicons:adjustments-vertical" | "heroicons:adjustments-vertical-16-solid" | "heroicons:adjustments-vertical-20-solid" | "heroicons:adjustments-vertical-solid" | "heroicons:archive-box" | "heroicons:archive-box-16-solid" | "heroicons:archive-box-20-solid" | "heroicons:archive-box-arrow-down" | "heroicons:archive-box-arrow-down-16-solid" | "heroicons:archive-box-arrow-down-20-solid" | "heroicons:archive-box-arrow-down-solid" | "heroicons:archive-box-solid" | "heroicons:archive-box-x-mark" | "heroicons:archive-box-x-mark-16-solid" | "heroicons:archive-box-x-mark-20-solid" | "heroicons:archive-box-x-mark-solid" | "heroicons:arrow-down" | "heroicons:arrow-down-16-solid" | "heroicons:arrow-down-20-solid" | "heroicons:arrow-down-circle" | "heroicons:arrow-down-circle-16-solid" | "heroicons:arrow-down-circle-20-solid" | "heroicons:arrow-down-circle-solid" | "heroicons:arrow-down-left" | "heroicons:arrow-down-left-16-solid" | "heroicons:arrow-down-left-20-solid" | "heroicons:arrow-down-left-solid" | "heroicons:arrow-down-on-square" | "heroicons:arrow-down-on-square-16-solid" | "heroicons:arrow-down-on-square-20-solid" | "heroicons:arrow-down-on-square-solid" | "heroicons:arrow-down-on-square-stack" | "heroicons:arrow-down-on-square-stack-16-solid" | "heroicons:arrow-down-on-square-stack-20-solid" | "heroicons:arrow-down-on-square-stack-solid" | "heroicons:arrow-down-right" | "heroicons:arrow-down-right-16-solid" | "heroicons:arrow-down-right-20-solid" | "heroicons:arrow-down-right-solid" | "heroicons:arrow-down-solid" | "heroicons:arrow-down-tray" | "heroicons:arrow-down-tray-16-solid" | "heroicons:arrow-down-tray-20-solid" | "heroicons:arrow-down-tray-solid" | "heroicons:arrow-left" | "heroicons:arrow-left-16-solid" | "heroicons:arrow-left-20-solid" | "heroicons:arrow-left-circle" | "heroicons:arrow-left-circle-16-solid" | "heroicons:arrow-left-circle-20-solid" | "heroicons:arrow-left-circle-solid" | "heroicons:arrow-left-end-on-rectangle" | "heroicons:arrow-left-end-on-rectangle-16-solid" | "heroicons:arrow-left-end-on-rectangle-20-solid" | "heroicons:arrow-left-end-on-rectangle-solid" | "heroicons:arrow-left-on-rectangle" | "heroicons:arrow-left-on-rectangle-20-solid" | "heroicons:arrow-left-on-rectangle-solid" ...
plugins: [ function blog(options?: StudioCMSBlogOptions): StudioCMSPluginDef
Creates and configures the StudioCMS Blog plugin.
blog(), ],});Création d’une interface frontend personnalisée
Section intitulée « Création d’une interface frontend personnalisée »Si vous souhaitez créer un frontend personnalisé pour votre projet StudioCMS, vous pouvez utiliser le SDK de StudioCMS ou l’API Rest de StudioCMS pour récupérer et un module d’extension de rendu pour StudioCMS afin d’afficher le contenu de StudioCMS sur vos pages personnalisées.
Si vous souhaitez créer un frontend personnalisé pour votre projet StudioCMS, vous pouvez utiliser le composant Renderer et le SDK de StudioCMS pour afficher le contenu de StudioCMS sur vos pages personnalisées.
Consultez les guides des frontend personnalisés pour plus de guides et de tutoriels sur la création d’un frontend personnalisé avec StudioCMS.
Créer et déployer votre projet StudioCMS
Section intitulée « Créer et déployer votre projet StudioCMS »Après avoir effectué les premières étapes de configuration, vous devriez créer et déployer votre projet StudioCMS sur votre serveur.
Par défaut, le tableau de bord de StudioCMS est disponible à l’adresse http://votre-domaine.tld/dashboard.
Ce tableau de bord sera à votre disposition pour gérer votre contenu et vos paramètres en mode développement et en mode production.
Il est recommandé d’utiliser StudioCMS uniquement en mode production, car le tableau de bord est destiné à être utilisé par le projet compilé. (Vous pourriez rencontrer des problèmes/erreurs en mode développement, comme une erreur de dépendances provenant de Vite.)
Prochaines étapes
Section intitulée « Prochaines étapes »Découvrez comment définir les Variables d’environnement dans StudioCMS.
Consultez le Catalogue de paquets pour rechercher et utiliser des modules d’extension avec StudioCMS.
Apprenez-en plus sur les options de configuration de StudioCMS à l’aide des pages Référence de StudioCMS.