Skip to main content

URL の /docs/ が不要

やりたいこと

URL のベースをデフォルトの /docs から / に変える

  • https://sugoi-domain.com/docs/ ← こうではなく
  • https://sugoi-domain.com/ ← こうしたい、という話

設定箇所

2箇所ある要注意。

  • baseUrl はサイト全体のルートURL
  • routeBasePath はドキュメントのルーティング設定
docusaurus.config.ts
const config: Config = {
...
baseUrl: '/',
..
presets: [
[
'classic',
{
docs: {
routeBasePath: '/',
...
}