라우팅
도큐사우루스의 라우팅 시스템은 단일 페이지 애플리케이션 규칙을 따릅니다. 하나의 경로, 하나의 컴포넌트. 세 가지 콘텐츠 플러그인(문서, 블로그, 페이지) 내에서 라우팅에 대해 설명한 다음 기본 라우팅 시스템에 대해 설명합니다.
Routing in content plugins
Every content plugin provides a routeBasePath
option. 해당 옵션에서는 플러그인이 경로를 추가하는 위치를 정의합니다. By default, the docs plugin puts its routes under /docs
; the blog plugin, /blog
; and the pages plugin, /
. 다음과 같이 경로 구조에 대해 생각할 수 있습니다.
모든 경로는 일치하는 항목이 발견될 때까지 중첩된 경로 설정을 탐색합니다. For example, when given a route /docs/configuration
, Docusaurus first enters the /docs
branch, and then searches among the subroutes created by the docs plugin.
Changing routeBasePath
can effectively alter your site's route structure. For example, in Docs-only mode, we mentioned that configuring routeBasePath: '/'
for docs means that all routes that the docs plugin create would not have the /docs
prefix, yet it doesn't prevent you from having more subroutes like /blog
created by other plugins.
다음은 세 가지 플러그인이 자체 "서브라우트 박스"를 구성하는 방법을 살펴보겠습니다.