📦 plugin-content-pages
도큐사우루스의 기본 페이지 플러그인입니다. 클래식 템플릿에는 기본 설정으로 플러그인이 포함되어 있습니다. This plugin provides creating pages functionality.
설치
- npm
- Yarn
- pnpm
- Bun
npm install --save @docusaurus/plugin-content-pages
yarn add @docusaurus/plugin-content-pages
pnpm add @docusaurus/plugin-content-pages
bun add @docusaurus/plugin-content-pages
팁
If you use the preset @docusaurus/preset-classic, you don't need to install this plugin as a dependency.
You can configure this plugin through the preset options.
설정
설정할 수 있는 필드
| 옵션명 | 타입 | 기본값 | 설명 |
|---|---|---|---|
path | string | 'src/pages' | 사이드 디렉토리에 상대적인 파일 시스템의 데이터 경로입니다. 디렉토리 내 컴포넌트는 자동으로 페이지로 변환됩니다. |
editUrl | string | EditUrlFn | undefined | Only for Markdown pages. 사이트를 편집하기 위한 Base URL입니다. The final URL is computed by editUrl + relativePostPath. 옵션 사용 시 각 파일에 대한 세밀한 제어를 할 수 있습니다. 해당 필드를 설정하지 않으면 편집 링크가 비활성화됩니다. |
editLocalizedFiles | boolean | false | Only for Markdown pages. 편집 URL은 현지화되지 않은 원본 파일 대신 현지화된 파일을 대상으로 합니다. Ignored when editUrl is a function. |
routeBasePath | string | '/' | 사이트 페이지 섹션에 대한 URL 라우트 DO NOT include a trailing slash. |
include | string[] | ['**/*.{js,jsx,ts,tsx,md,mdx}'] | 일치하는 파일이 포함되어 처리됩니다. |
exclude | string[] | See example configuration | 일치하는 파일에 대한 라우트가 생성되지 않습니다. |
mdxPageComponent | string | '@theme/MDXPage' | 각 MDX 페이지에서 사용하는 컴포넌트 |
remarkPlugins | [] | any[] | MDX에 전달된 Remark 플러그인 |
rehypePlugins | [] | any[] | MDX에 전달된 Rehype 플러그인 |
rehypePlugins | any[] | [] | Recma plugins passed to MDX. |
beforeDefaultRemarkPlugins | any[] | [] | 기본 도큐사우루스 Remark 플러그인보다 먼저 MDX에 전달된 사용자 지정 Remark 플러그인 |
beforeDefaultRehypePlugins | any[] | [] | 기본 도큐사우루스 Rehype 플러그인보다 먼저 MDX에 전달된 사용자 지정 Rehype 플러그인 |
showLastUpdateAuthor | boolean | false | Only for Markdown pages. Whether to display the author who last updated the page. |
showLastUpdateTime | boolean | false | Only for Markdown pages. Whether to display the last date the page post was updated. This requires access to git history during the build, so will not work correctly with shallow clones (a common default for CI systems). With GitHub actions/checkout, usefetch-depth: 0. |
타입
EditUrlFn
type EditUrlFunction = (params: {
blogDirPath: string;
blogPath: string;
permalink: string;
locale: string;
}) => string | undefined;
설정 예시
프리셋 옵션이나 플러그인 옵션에서 플러그인을 설정할 수 있습니다.
팁
대부분의 도큐사우루스 사용자는 프리셋 옵션을 사용해 플러그인을 설정합니다.
- 프리셋 옵션
- 플러그인 옵션