컨텐츠로 건너뛰기

StudioCMS 구성

StudioCMS 통합을 구성하는 두 가지 방법이 있습니다. 아래는 astro.config.mjs 파일을 사용하거나 전용 studiocms.config.mjs 파일을 사용하여 구성하는 방법의 예시입니다.

이 페이지에서는 StudioCMS 구성을 어떻게, 어디에 정의하는지 보여줍니다. StudioCMS 구성 옵션에 대한 자세한 내용은 참조 페이지를 확인하세요.

astro.config.mjs
import
function db(): AstroIntegration[]
db
from '@astrojs/db';
import
function node(userOptions: UserOptions): AstroIntegration
node
from '@astrojs/node';
import
const studioCMS: (options?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
dbStartPage?: boolean | undefined;
imageService?: {
cdnPlugin?: "cloudinary-js" | undefined;
} | undefined;
defaultFrontEndConfig?: boolean | {
htmlDefaultLanguage?: string | undefined;
htmlDefaultHead?: {
tag: "link" | "title" | "base" | "style" | "meta" | "script" | "noscript" | "template";
attrs?: Record<string, string | boolean | undefined> | undefined;
content?: string | undefined;
}[] | undefined;
favicon?: string | undefined;
injectQuickActionsMenu?: boolean | undefined;
} | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username ...

StudioCMS Integration

A CMS built for Astro by the Astro Community for the Astro Community.

@seeThe GitHub Repo: withstudiocms/studiocms for more information on how to contribute to StudioCMS.

@seeThe StudioCMS Docs for more information on how to use StudioCMS.

studioCMS
from 'studiocms';
import {
function defineConfig<const TLocales extends Locales = never, const TDriver extends SessionDriverName = never>(config: AstroUserConfig<TLocales, TDriver>): AstroUserConfig<TLocales, TDriver>

See the full Astro Configuration API Documentation https://astro.build/config

defineConfig
} from 'astro/config';
export default
defineConfig<never, never>(config: AstroUserConfig<never, never>): AstroUserConfig<never, never>

See the full Astro Configuration API Documentation https://astro.build/config

defineConfig
({
AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never>.site?: string

@namesite

@type{string}

@description

Your final, deployed URL. Astro uses this full URL to generate your sitemap and canonical URLs in your final build. It is strongly recommended that you set this configuration to get the most out of Astro.

{
site: 'https://www.my-site.dev'
}

site
: 'https://demo.studiocms.dev/',
AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never>.output?: "server" | "static"

@nameoutput

@type{('static' | 'server')}

@default'static'

@seeadapter *

@description

Specifies the output target for builds.

  • 'static' - Prerender all your pages by default, outputting a completely static site if none of your pages opt out of prerendering.
  • 'server' - Use server-side rendering (SSR) for all pages by default, always outputting a server-rendered site.
import { defineConfig } from 'astro/config';
export default defineConfig({
output: 'static'
})

output
: 'server',
AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never>.adapter?: AstroIntegration

@nameadapter

@seeoutput *

@description

Deploy to your favorite server, serverless, or edge host with build adapters. Import one of our first-party adapters for Netlify, Vercel, and more to engage Astro SSR.

See our On-demand Rendering guide for more on SSR, and our deployment guides for a complete list of hosts.

import netlify from '@astrojs/netlify';
{
// Example: Build for Netlify serverless deployment
adapter: netlify(),
}

adapter
:
function node(userOptions: UserOptions): AstroIntegration
node
({
UserOptions.mode: "standalone" | "middleware"

Specifies the mode that the adapter builds to.

  • 'middleware' - Build to middleware, to be used within another Node.js server, such as Express.
  • 'standalone' - Build to a standalone server. The server starts up just by running the built script.

mode
: "standalone" }),
AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never>.integrations?: (false | AstroIntegration | (false | AstroIntegration | null | undefined)[] | null | undefined)[]

@nameintegrations

@description

Extend Astro with custom integrations. Integrations are your one-stop-shop for adding framework support (like Solid.js), new features (like sitemaps), and new libraries (like Partytown).

Read our Integrations Guide for help getting started with Astro Integrations.

import react from '@astrojs/react';
import mdx from '@astrojs/mdx';
{
// Example: Add React + MDX support to Astro
integrations: [react(), mdx()]
}

integrations
: [
function db(): AstroIntegration[]
db
(),
function studioCMS(options?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
dbStartPage?: boolean | undefined;
imageService?: {
cdnPlugin?: "cloudinary-js" | undefined;
} | undefined;
defaultFrontEndConfig?: boolean | {
htmlDefaultLanguage?: string | undefined;
htmlDefaultHead?: {
tag: "link" | "title" | "base" | "style" | "meta" | "script" | "noscript" | "template";
attrs?: Record<string, string | boolean | undefined> | undefined;
content?: string | undefined;
}[] | undefined;
favicon?: string | undefined;
injectQuickActionsMenu?: boolean | undefined;
} | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username ...

StudioCMS Integration

A CMS built for Astro by the Astro Community for the Astro Community.

@seeThe GitHub Repo: withstudiocms/studiocms for more information on how to contribute to StudioCMS.

@seeThe StudioCMS Docs for more information on how to use StudioCMS.

studioCMS
({
dbStartPage?: boolean | undefined
dbStartPage
: false,
// 기타 구성 옵션
}),
],
});

이 파일은 자동으로 선택되며, 이 옵션을 사용하기로 선택한 경우 astro.config.mjs에 전달된 모든 옵션을 덮어씁니다. 아래와 같이 모든 StudioCMS 구성 옵션을 이 파일로 옮겨야 합니다.

  • .env
  • astro.config.mjs
  • studiocms.config.mjs
  • studiocms-auth.config.json 자동 생성됨
  • package.json
  • 디렉터리src
    • env.d.ts
astro.config.mjs
import
function db(): AstroIntegration[]
db
from '@astrojs/db';
import
function node(userOptions: UserOptions): AstroIntegration
node
from '@astrojs/node';
import
const studioCMS: (options?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
dbStartPage?: boolean | undefined;
imageService?: {
cdnPlugin?: "cloudinary-js" | undefined;
} | undefined;
defaultFrontEndConfig?: boolean | {
htmlDefaultLanguage?: string | undefined;
htmlDefaultHead?: {
tag: "link" | "title" | "base" | "style" | "meta" | "script" | "noscript" | "template";
attrs?: Record<string, string | boolean | undefined> | undefined;
content?: string | undefined;
}[] | undefined;
favicon?: string | undefined;
injectQuickActionsMenu?: boolean | undefined;
} | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username ...

StudioCMS Integration

A CMS built for Astro by the Astro Community for the Astro Community.

@seeThe GitHub Repo: withstudiocms/studiocms for more information on how to contribute to StudioCMS.

@seeThe StudioCMS Docs for more information on how to use StudioCMS.

studioCMS
from 'studiocms';
import {
function defineConfig<const TLocales extends Locales = never, const TDriver extends SessionDriverName = never>(config: AstroUserConfig<TLocales, TDriver>): AstroUserConfig<TLocales, TDriver>

See the full Astro Configuration API Documentation https://astro.build/config

defineConfig
} from 'astro/config';
export default
defineConfig<never, never>(config: AstroUserConfig<never, never>): AstroUserConfig<never, never>

See the full Astro Configuration API Documentation https://astro.build/config

defineConfig
({
AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never>.site?: string

@namesite

@type{string}

@description

Your final, deployed URL. Astro uses this full URL to generate your sitemap and canonical URLs in your final build. It is strongly recommended that you set this configuration to get the most out of Astro.

{
site: 'https://www.my-site.dev'
}

site
: 'https://demo.studiocms.dev/',
AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never>.output?: "server" | "static"

@nameoutput

@type{('static' | 'server')}

@default'static'

@seeadapter *

@description

Specifies the output target for builds.

  • 'static' - Prerender all your pages by default, outputting a completely static site if none of your pages opt out of prerendering.
  • 'server' - Use server-side rendering (SSR) for all pages by default, always outputting a server-rendered site.
import { defineConfig } from 'astro/config';
export default defineConfig({
output: 'static'
})

output
: 'server',
AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never>.adapter?: AstroIntegration

@nameadapter

@seeoutput *

@description

Deploy to your favorite server, serverless, or edge host with build adapters. Import one of our first-party adapters for Netlify, Vercel, and more to engage Astro SSR.

See our On-demand Rendering guide for more on SSR, and our deployment guides for a complete list of hosts.

import netlify from '@astrojs/netlify';
{
// Example: Build for Netlify serverless deployment
adapter: netlify(),
}

adapter
:
function node(userOptions: UserOptions): AstroIntegration
node
({
UserOptions.mode: "standalone" | "middleware"

Specifies the mode that the adapter builds to.

  • 'middleware' - Build to middleware, to be used within another Node.js server, such as Express.
  • 'standalone' - Build to a standalone server. The server starts up just by running the built script.

mode
: "standalone" }),
AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never>.integrations?: (false | AstroIntegration | (false | AstroIntegration | null | undefined)[] | null | undefined)[]

@nameintegrations

@description

Extend Astro with custom integrations. Integrations are your one-stop-shop for adding framework support (like Solid.js), new features (like sitemaps), and new libraries (like Partytown).

Read our Integrations Guide for help getting started with Astro Integrations.

import react from '@astrojs/react';
import mdx from '@astrojs/mdx';
{
// Example: Add React + MDX support to Astro
integrations: [react(), mdx()]
}

integrations
: [
function db(): AstroIntegration[]
db
(),
function studioCMS(options?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
dbStartPage?: boolean | undefined;
imageService?: {
cdnPlugin?: "cloudinary-js" | undefined;
} | undefined;
defaultFrontEndConfig?: boolean | {
htmlDefaultLanguage?: string | undefined;
htmlDefaultHead?: {
tag: "link" | "title" | "base" | "style" | "meta" | "script" | "noscript" | "template";
attrs?: Record<string, string | boolean | undefined> | undefined;
content?: string | undefined;
}[] | undefined;
favicon?: string | undefined;
injectQuickActionsMenu?: boolean | undefined;
} | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username ...

StudioCMS Integration

A CMS built for Astro by the Astro Community for the Astro Community.

@seeThe GitHub Repo: withstudiocms/studiocms for more information on how to contribute to StudioCMS.

@seeThe StudioCMS Docs for more information on how to use StudioCMS.

studioCMS
() ],
});
studiocms.config.mjs
import {
function defineStudioCMSConfig(config: StudioCMSOptions): {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
dbStartPage?: boolean | undefined;
imageService?: {
cdnPlugin?: "cloudinary-js" | undefined;
} | undefined;
defaultFrontEndConfig?: boolean | {
htmlDefaultLanguage?: string | undefined;
htmlDefaultHead?: {
tag: "link" | "title" | "base" | "style" | "meta" | "script" | "noscript" | "template";
attrs?: Record<string, string | boolean | undefined> | undefined;
content?: string | undefined;
}[] | undefined;
favicon?: string | undefined;
injectQuickActionsMenu?: boolean | undefined;
} | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: 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
} from "studiocms/config";
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
dbStartPage?: boolean | undefined;
imageService?: {
cdnPlugin?: "cloudinary-js" | undefined;
} | undefined;
defaultFrontEndConfig?: boolean | {
htmlDefaultLanguage?: string | undefined;
htmlDefaultHead?: {
tag: "link" | "title" | "base" | "style" | "meta" | "script" | "noscript" | "template";
attrs?: Record<string, string | boolean | undefined> | undefined;
content?: string | undefined;
}[] | undefined;
favicon?: string | undefined;
injectQuickActionsMenu?: boolean | undefined;
} | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: 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
({
dbStartPage?: boolean | undefined
dbStartPage
: false,
// 기타 구성 옵션
})