Skip to main content
버전: 3.9.2

📦 plugin-content-docs

Provides the Docs functionality and is the default docs plugin for Docusaurus.

설치

npm install --save @docusaurus/plugin-content-docs

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.

설정

설정할 수 있는 필드

옵션명타입기본값설명
pathstring'docs'사이트 디렉토리에 상대적인 파일 시스템의 문서 콘텐츠 디렉토리 경로입니다.
editUrlstring | EditUrlFunctionundefined사이트를 편집하기 위한 Base URL입니다. The final URL is computed by editUrl + relativeDocPath. 옵션 사용 시 각 파일에 대한 세밀한 제어를 할 수 있습니다. 해당 필드를 설정하지 않으면 편집 링크가 비활성화됩니다.
editLocalizedFilesbooleanfalse편집 URL은 현지화되지 않은 원본 파일 대신 현지화된 파일을 대상으로 합니다. Ignored when editUrl is a function.
editCurrentVersionbooleanfalse편집 URL은 항상 이전 버전 대신 현재 버전 문서를 대상으로 합니다. Ignored when editUrl is a function.
routeBasePathstring'docs'사이트 문서 섹션에 대한 URL 라우트 DO NOT include a trailing slash. Use / for shipping docs without base path.
tagsBasePathstring'tags'사이트 태그 목록 페이지에 대한 URL 라우트 It is prepended to the routeBasePath.
includestring[]['**/*.{md,mdx}']콘텐츠 경로를 기준으로 빌드할 마크다운 파일과 일치하는 glob 패턴 배열입니다.
excludestring[]See example configuration제외할 마크다운 파일과 일치하는 glob 패턴 배열입니다. Serves as refinement based on the include option.
sidebarPathfalse | stringundefinedPath to a sidebars configuration file, loaded in a Node.js context. Use false to disable sidebars, or undefined to create a fully autogenerated sidebar.
sidebarCollapsiblebooleantrue기본적으로 사이드바 카테고리를 접을 수 있는지 여부를 설정합니다. See also Collapsible categories
sidebarCollapsedbooleantrue기본적으로 사이드바 카테고리를 접을지 여부를 설정합니다. See also Expanded categories by default
sidebarItemsGeneratorSidebarGeneratorOmittedFunction used to replace the sidebar items of type 'autogenerated' with real sidebar items (docs, categories, links...). See also Customize the sidebar items generator
numberPrefixParserboolean | PrefixParserOmitted파일명에서 숫자 접두사를 추출하는 사용자 지정 구문 분석 방식을 설정합니다. Use false to disable this behavior and leave the docs untouched, and true to use the default parser. See also Using number prefixes
docsRootComponentstring'@theme/DocsRoot'모든 문서 플러그인 페이지(모든 버전 포함)의 상위 컴포넌트입니다. 문서 페이지와 버전 사이를 탐색할 때 마운트된 상태로 유지됩니다.
docVersionRootComponentstring'@theme/DocVersionLayout'개별 버전의 모든 문서 페이지(사이드바가 있는 문서 페이지, 태그 페이지)의 상위 컴포넌트입니다. 특정 버전의 페이지 사이를 탐색할 때 마운트된 상태로 유지됩니다.
docRootComponentstring'@theme/DocRoot'사이드바가 있는 모든 문서 페이지(일반 문서 페이지, 카테고리 생성 색인 페이지)의 상위 컴포넌트입니다. 각 페이지 사이를 탐색할 때 마운트된 상태로 유지됩니다.
docItemComponentstring'@theme/DocItem'목차, 페이지 영역 등 기본 문서 컨테이너
docTagsListComponentstring'@theme/DocTagsListPage'태그 목록 페이지의 루트 컴포넌트
docTagDocListComponentstring'@theme/DocTagDocListPage'"태그 X를 포함한 문서" 페이지의 루트 컴포넌트
docCategoryGeneratedIndexComponentstring'@theme/DocCategoryGeneratedIndexPage'생성된 카테고리 인덱스 페이지의 루트 컴포넌트
remarkPluginsany[][]MDX에 전달된 Remark 플러그인
rehypePluginsany[][]MDX에 전달된 Rehype 플러그인
rehypePluginsany[][]Recma plugins passed to MDX.
beforeDefaultRemarkPluginsany[][]기본 도큐사우루스 Remark 플러그인보다 먼저 MDX에 전달된 사용자 지정 Remark 플러그인
beforeDefaultRehypePluginsany[][]기본 도큐사우루스 Rehype 플러그인보다 먼저 MDX에 전달된 사용자 지정 Rehype 플러그인
showLastUpdateAuthorbooleanfalse문서를 마지막으로 업데이트한 작성자를 표시할지 여부
showLastUpdateTimebooleanfalseWhether to display the last date the doc 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.
disableVersioningbooleanfalse여러 버전이 있더라도 명시적으로 버전 관리를 비활성화합니다. 이렇게 하면 사이트에 현재 버전만 포함됩니다. Will error if includeCurrentVersion: false and disableVersioning: true.
includeCurrentVersionbooleantrue문서의 현재 버전을 포함
lastVersionstringFirst version in versions.json문서 메뉴바 아이템에 대해 우선적으로 탐색되고 기본적으로 표시되는 버전
onlyIncludeVersionsstring[]사용할 수 있는 모든 버전사용할 수 있는 모든 버전의 하위 집합만 포함
versionsVersionsConfig{}각 버전의 속성을 독립적으로 사용자 지정합니다.
tagsstring | false | null | undefinedtags.ymlPath to a YAML file listing pre-defined tags. Relative to the docs version content directories.
onInlineTags'ignore' | 'log' | 'warn' | 'throw'warnThe plugin behavior when docs contain inline tags (not appearing in the list of pre-defined tags, usually docs/tags.yml).

타입

EditUrlFunction

type EditUrlFunction = (params: {
version: string;
versionDocsDirPath: string;
docPath: string;
permalink: string;
locale: string;
}) => string | undefined;

PrefixParser

type PrefixParser = (filename: string) => {
filename: string;
numberPrefix?: number;
};

SidebarGenerator

type SidebarGenerator = (generatorArgs: {
/** The sidebar item with type "autogenerated" to be transformed. */
item: {type: 'autogenerated'; dirName