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

๐Ÿ“ฆ plugin-content-pages

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

์„ค์น˜#

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

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.

์„ค์ •#

์„ค์ •ํ•  ์ˆ˜ ์žˆ๋Š” ํ•„๋“œ

NameTypeDefaultDescription
pathstring'src/pages'Path to data on filesystem relative to site dir. Components in this directory will be automatically converted to pages.
routeBasePathstring'/'URL route for the pages section of your site. DO NOT include a trailing slash.
includestring[]['**/*.{js,jsx,ts,tsx,md,mdx}']Matching files will be included and processed.
excludestring[]See example configurationNo route will be created for matching files.
mdxPageComponentstring'@theme/MDXPage'Component used by each MDX page.
remarkPlugins[]any[]Remark plugins passed to MDX.
rehypePlugins[]any[]Rehype plugins passed to MDX.
beforeDefaultRemarkPluginsany[][]Custom Remark plugins passed to MDX before the default Docusaurus Remark plugins.
beforeDefaultRehypePluginsany[][]Custom Rehype plugins passed to MDX before the default Docusaurus Rehype plugins.

์„ค์ • ์˜ˆ์‹œ#

Here's an example configuration object.

You can provide it as preset options or plugin options.

tip

Most Docusaurus users configure this plugin through the preset options.

const config = {  path: 'src/pages',  routeBasePath: '',  include: ['**/*.{js,jsx,ts,tsx,md,mdx}'],  exclude: [    '**/_*.{js,jsx,ts,tsx,md,mdx}',    '**/_*/**',    '**/*.test.{js,jsx,ts,tsx}',    '**/__tests__/**',  ],  mdxPageComponent: '@theme/MDXPage',  remarkPlugins: [require('remark-math')],  rehypePlugins: [],  beforeDefaultRemarkPlugins: [],  beforeDefaultRehypePlugins: [],};

Preset options#

If you use a preset, configure this plugin through the preset options:

docusaurus.config.js
module.exports = {  presets: [    [      '@docusaurus/preset-classic',      {        pages: {          path: 'src/pages',          // ... configuration object here        },      },    ],  ],};

Plugin options#

If you are using a standalone plugin, provide options directly to the plugin:

docusaurus.config.js
module.exports = {  plugins: [    [      '@docusaurus/plugin-content-pages',      {        path: 'src/pages',        // ... configuration object here      },    ],  ],};

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