버전 관리
You can use the versioning CLI to create a new documentation version based on the latest content in the docs
directory. That specific set of documentation will then be preserved and accessible even as the documentation in the docs
directory continues to evolve.
여러분의 문서에서 버전 관리를 시작하기 전에 충분한 검토가 필요합니다. 기여자들이 문서 내용을 개선하는 데 어려움이 생길 수도 있습니다.
일반적으로 버전 관리가 필요하지는 않습니다. 버전 관리 기능을 활성화하면 빌드 시간이 길어지고 코드의 복잡도도 늘어납니다. Versioning is best suited for websites with high-traffic and rapid changes to documentation between versions. 여러분이 관리하는 문서가 거의 변경이 없다면 버전 관리 기능을 사용할 필요는 없습니다.
버전 관리 기능이 어떻게 동작하고 여러분에게 필요한지 확인하려면 아래 내용을 계속 읽어주세요.
Overview
일반적으로 버전이 지정된 문서 사이트는 아래와 같은 형태입니다.
website
├── sidebars.json # 현재 버전 문서의 사이드바
├── docs # 현재 버전 문서의 문서 디렉터리
│ ├── foo
│ │ └── bar.md # https://mysite.com/docs/next/foo/bar
│ └── hello.md # https://mysite.com/docs/next/hello
├── versions.json # 사용할 수 있는 버전 정보가 명시된 파일
├── versioned_docs
│ ├── version-1.1.0
│ │ ├── foo
│ │ │ └── bar.md # https://mysite.com/docs/foo/bar
│ │ └── hello.md
│ └── version-1.0.0
│ ├── foo
│ │ └── bar.md # https://mysite.com/docs/1.0.0/foo/bar
│ └── hello.md
├── versioned_sidebars
│ ├── version-1.1.0-sidebars.json
│ └── version-1.0.0-sidebars.json
├── docusaurus.config.js
└── package.json
The versions.json
file is a list of version names, ordered from newest to oldest.
아래 표에서는 버전과 생성된 URL이 어떤 파일과 연결되는지 설명합니다.
경로 | 버전 | URL |
---|---|---|
versioned_docs/version-1.0.0/hello.md | 1.0.0 | /docs/1.0.0/hello |
versioned_docs/version-1.1.0/hello.md | 1.1.0 (최신) | /docs/hello |
docs/hello.md | current | /docs/next/hello |
The files in the docs
directory belong to the current
docs version.
By default, the current
docs version is labeled as Next
and hosted under /docs/next/*
, but it is entirely configurable to fit your project's release lifecycle.
Terminology
여기에서 사용하는 용어에 유의하세요.
- Current version
- The version placed in the
./docs
folder. - Latest version / last version
- The version served by default for docs navbar items. 일반적인 경로는
/docs
입니다.
Current version is defined by the file system location, while latest version is defined by the the navigation behavior. 같은 버전이 될 수도 있고 그렇지 않을 수도 있습니다! (And the default configuration, as shown in the table above, would treat them as different: current version at /docs/next
and latest at /docs
.)
Tutorials
Tagging a new version
- First, make sure the current docs version (the
./docs
directory) is ready to be frozen. - 새로운 버전 번호를 부여합니다.
- npm
- Yarn
- pnpm
npm run docusaurus docs:version 1.1.0