๐ฆ plugin-content-pages
๋ํ์ฌ์ฐ๋ฃจ์ค์ ๊ธฐ๋ณธ ํ์ด์ง ํ๋ฌ๊ทธ์ธ์ ๋๋ค. ํด๋์ ํ ํ๋ฆฟ์๋ ๊ธฐ๋ณธ ์ค์ ์ผ๋ก ํ๋ฌ๊ทธ์ธ์ด ํฌํจ๋์ด ์์ต๋๋ค. This plugin provides creating pages functionality.
Installationโ
- npm
- Yarn
- pnpm
npm install --save @docusaurus/plugin-content-pages
yarn add @docusaurus/plugin-content-pages
pnpm add @docusaurus/plugin-content-pages
If you use the preset @docusaurus/preset-classic
, you don't need to install this plugin as a dependency.
์ฌ๋ฌ๋ถ์ ํ๋ฆฌ์ ์ต์ ์ ์ฌ์ฉํด ํ๋ฌ๊ทธ์ธ์ ์ค์ ํ ์ ์์ต๋๋ค.
Configurationโ
์ค์ ํ ์ ์๋ ํ๋
์ต์ ๋ช | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช |
---|---|---|---|
path | string | 'src/pages' | ์ฌ์ด๋ ๋๋ ํ ๋ฆฌ์ ์๋์ ์ธ ํ์ผ ์์คํ ์ ๋ฐ์ดํฐ ๊ฒฝ๋ก์ ๋๋ค. ๋๋ ํ ๋ฆฌ ๋ด ์ปดํฌ๋ํธ๋ ์๋์ผ๋ก ํ์ด์ง๋ก ๋ณํ๋ฉ๋๋ค. |
routeBasePath | string | '/' | ์ฌ์ดํธ ํ์ด์ง ์น์ ์ ๋ํ URL ๋ผ์ฐํธ DO NOT include a trailing slash. |
include | string[] | ['**/*.{js,jsx,ts,tsx,md,mdx}'] | ์ผ์นํ๋ ํ์ผ์ด ํฌํจ๋์ด ์ฒ๋ฆฌ๋ฉ๋๋ค. |
exclude | string[] | See example configuration | ์ผ์นํ๋ ํ์ผ์ ๋ํ ๋ผ์ฐํธ๊ฐ ์์ฑ๋์ง ์์ต๋๋ค. |
mdxPageComponent | string | '@theme/MDXPage' | ๊ฐ MDX ํ์ด์ง์์ ์ฌ์ฉํ๋ ์ปดํฌ๋ํธ |
remarkPlugins | [] | any[] | MDX์ ์ ๋ฌ๋ Remark ํ๋ฌ๊ทธ์ธ |
rehypePlugins | [] | any[] | MDX์ ์ ๋ฌ๋ Rehype ํ๋ฌ๊ทธ์ธ |
beforeDefaultRemarkPlugins | any[] | [] | ๊ธฐ๋ณธ ๋ํ์ฌ์ฐ๋ฃจ์ค Remark ํ๋ฌ๊ทธ์ธ๋ณด๋ค ๋จผ์ MDX์ ์ ๋ฌ๋ ์ฌ์ฉ์ ์ง์ Remark ํ๋ฌ๊ทธ์ธ |
beforeDefaultRehypePlugins | any[] | [] | ๊ธฐ๋ณธ ๋ํ์ฌ์ฐ๋ฃจ์ค Rehype ํ๋ฌ๊ทธ์ธ๋ณด๋ค ๋จผ์ MDX์ ์ ๋ฌ๋ ์ฌ์ฉ์ ์ง์ Rehype ํ๋ฌ๊ทธ์ธ |
Example configurationโ
ํ๋ฆฌ์ ์ต์ ์ด๋ ํ๋ฌ๊ทธ์ธ ์ต์ ์์ ํ๋ฌ๊ทธ์ธ์ ์ค์ ํ ์ ์์ต๋๋ค.
๋๋ถ๋ถ์ ๋ํ์ฌ์ฐ๋ฃจ์ค ์ฌ์ฉ์๋ ํ๋ฆฌ์ ์ต์ ์ ์ฌ์ฉํด ํ๋ฌ๊ทธ์ธ์ ์ค์ ํฉ๋๋ค.
- Preset options
- Plugin options
If you use a preset, configure this plugin through the preset options:
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
pages: {
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: [],
},
},
],
],
};
If you are using a standalone plugin, provide options directly to the plugin:
module.exports = {
plugins: [
[
'@docusaurus/plugin-content-pages',
{
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: [],
},
],
],
};
i18nโ
Read the i18n introduction first.
Translation files locationโ
- Base path:
website/i18n/[locale]/docusaurus-plugin-content-pages
- Multi-instance path:
website/i18n/[locale]/docusaurus-plugin-content-pages-[pluginId]
- JSON files: extracted with
docusaurus write-translations
- Markdown files:
website/i18n/[locale]/docusaurus-plugin-content-pages
Example file-system structureโ
website/i18n/[locale]/docusaurus-plugin-content-pages
โ
โ # translations for website/src/pages
โโโ first-markdown-page.md
โโโ second-markdown-page.md