๋ฉ”์ธ ์ปจํ…์ธ ๋กœ ์ด๋™
Version: 2.0.0-beta.5 ๐Ÿšง

๐Ÿ“ฆ plugin-content-pages

๋„ํ์‚ฌ์šฐ๋ฃจ์Šค์˜ ๊ธฐ๋ณธ ํŽ˜์ด์ง€ ํ”Œ๋Ÿฌ๊ทธ์ธ์ž…๋‹ˆ๋‹ค. ํด๋ž˜์‹ ํ…œํ”Œ๋ฆฟ์—๋Š” ๊ธฐ๋ณธ ์„ค์ •์œผ๋กœ ํ”Œ๋Ÿฌ๊ทธ์ธ์ด ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ํŽ˜์ด์ง€ ๋งŒ๋“ค๊ธฐ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•˜๋Š” ํ”Œ๋Ÿฌ๊ทธ์ธ์ž…๋‹ˆ๋‹ค.

์„ค์น˜#

npm install --save @docusaurus/plugin-content-pages
tip

@docusaurus/preset-classic์„ ์„ค์น˜ํ•œ ๊ฒฝ์šฐ์—๋Š” ๊ธฐ๋ณธ ํŽ˜์ด์ง€ ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ๋”ฐ๋กœ ์„ค์น˜ํ•  ํ•„์š”๋Š” ์—†์Šต๋‹ˆ๋‹ค. ์•„๋ž˜์™€ ๊ฐ™์ด ์„ค์ •ํ•˜๋Š” ๋Œ€์‹  classic preset options์—์„œ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์„ค์ •#

docusaurus.config.js
module.exports = {  plugins: [    [      '@docusaurus/plugin-content-pages',      {        /**         * ์‚ฌ์ดํŠธ ๋””๋ ‰ํ„ฐ๋ฆฌ์˜ ์ƒ๋Œ€ ๊ฒฝ๋กœ๋กœ         * ํŒŒ์ผ ์‹œ์Šคํ…œ์˜ ๋ฐ์ดํ„ฐ ๊ฒฝ๋กœ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.         * ๋””๋ ‰ํ„ฐ๋ฆฌ ๋‚ด ์ปดํฌ๋„ŒํŠธ๋Š” ์ž๋™์œผ๋กœ ํŽ˜์ด์ง€๋กœ ๋ณ€ํ™˜๋ฉ๋‹ˆ๋‹ค.         */        path: 'src/pages',        /**         * ์—ฌ๋Ÿฌ๋ถ„์˜ ์‚ฌ์ดํŠธ ํŽ˜์ด์ง€ URL ๊ฒฝ๋กœ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.         * ์ ˆ๋Œ€ URL ๋์— ์Šฌ๋ž˜์‹œ๋ฅผ ๋ถ™์ด์ง€ ๋งˆ์„ธ์š”.         */        routeBasePath: '',        include: ['**/*.{js,jsx,ts,tsx,md,mdx}'],        /**         * ์•„๋ž˜ ์„ค์ •ํ•œ ํŒŒ์ผ์€ ๋ผ์šฐํŠธ ์ฒ˜๋ฆฌ๋ฅผ ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.         */        exclude: [          '**/_*.{js,jsx,ts,tsx,md,mdx}',          '**/_*/**',          '**/*.test.{js,jsx,ts,tsx}',          '**/__tests__/**',        ],        /**         * ๋งˆํฌ๋‹ค์šด ํŽ˜์ด์ง€์—์„œ ์‚ฌ์šฉํ•  ํ…Œ๋งˆ ์ปดํฌ๋„ŒํŠธ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.         */        mdxPageComponent: '@theme/MDXPage',        /**         * MDX์— ์ „๋‹ฌํ•  Remark, Rehype ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.         */        remarkPlugins: [],        rehypePlugins: [],        /**         * ๊ธฐ๋ณธ Remark, Rehype ํ”Œ๋Ÿฌ๊ทธ์ธ์ด ์ ์šฉ๋˜๊ธฐ ์ „์—         * MDX์— ์‚ฌ์šฉ์ž ์ง€์ • Remark, Rehype ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์ „๋‹ฌํ•˜๋„๋ก ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.         */        beforeDefaultRemarkPlugins: [],        beforeDefaultRehypePlugins: [],      },    ],  ],};

i18n#

i18n ์†Œ๊ฐœ ๋ฌธ์„œ๋ฅผ ๋จผ์ € ํ™•์ธํ•ด์ฃผ์„ธ์š”.

๋ฒˆ์—ญ ํŒŒ์ผ ์œ„์น˜#

  • ๊ธฐ๋ณธ ๊ฒฝ๋กœ: website/i18n/<locale>/docusaurus-plugin-content-pages
  • ๋ฉ€ํ‹ฐ ์ธ์Šคํ„ด์Šค ๊ฒฝ๋กœ: website/i18n/<locale>/docusaurus-plugin-content-pages-<pluginId>
  • JSON ํŒŒ์ผ: docusaurus write-translations ๋ช…๋ น ์‹คํ–‰ ํ›„ ๋งŒ๋“ค์–ด์ง„ ํŒŒ์ผ
  • ๋งˆํฌ๋‹ค์šด ํŒŒ์ผ: website/i18n/<locale>/docusaurus-plugin-content-pages

ํŒŒ์ผ ์‹œ์Šคํ…œ ๊ตฌ์กฐ ์˜ˆ#

website/i18n/<locale>/docusaurus-plugin-content-pagesโ”‚โ”‚ # translations for website/src/pagesโ”œโ”€โ”€ first-markdown-page.mdโ””โ”€โ”€ second-markdown-page.md