π¦ plugin-content-pages
λνμ¬μ°λ£¨μ€μ κΈ°λ³Έ νμ΄μ§ νλ¬κ·ΈμΈμ λλ€. ν΄λμ ν νλ¦Ώμλ κΈ°λ³Έ μ€μ μΌλ‘ νλ¬κ·ΈμΈμ΄ ν¬ν¨λμ΄ μμ΅λλ€. νμ΄μ§ λ§λ€κΈ° κΈ°λ₯μ μ 곡νλ νλ¬κ·ΈμΈμ λλ€.
μ€μΉβ
- npm
- Yarn
- pnpm
npm install --save @docusaurus/plugin-content-pages
yarn add @docusaurus/plugin-content-pages
pnpm add @docusaurus/plugin-content-pages
@docusaurus/preset-classic
μ μ€μΉν κ²½μ°μλ νλ¬κ·ΈμΈμ λ°λ‘ μ€μΉν νμλ μμ΅λλ€.
μ¬λ¬λΆμ ν리μ μ΅μ μ μ¬μ©ν΄ νλ¬κ·ΈμΈμ μ€μ ν μ μμ΅λλ€.
μ€μ β
μ€μ ν μ μλ νλ
μ΅μ λͺ | νμ | κΈ°λ³Έκ° | μ€λͺ |
---|---|---|---|
path | string | 'src/pages' | μ¬μ΄λ λλ ν 리μ μλμ μΈ νμΌ μμ€ν μ λ°μ΄ν° κ²½λ‘μ λλ€. λλ ν 리 λ΄ μ»΄ν¬λνΈλ μλμΌλ‘ νμ΄μ§λ‘ λ³νλ©λλ€. |
routeBasePath | string | '/' | μ¬μ΄νΈ νμ΄μ§ μΉμ μ λν URL λΌμ°νΈ νΈλ μΌλ§ μ¬λμλ₯Ό ν¬ν¨νμ§ λ§μΈμ. |
include | string[] | ['**/*.{js,jsx,ts,tsx,md,mdx}'] | μΌμΉνλ νμΌμ΄ ν¬ν¨λμ΄ μ²λ¦¬λ©λλ€. |
exclude | string[] | μ€μ μμλ₯Ό μ°Έμ‘°νμΈμ | μΌμΉνλ νμΌμ λν λΌμ°νΈκ° μμ±λμ§ μμ΅λλ€. |
mdxPageComponent | string | '@theme/MDXPage' | κ° MDX νμ΄μ§μμ μ¬μ©νλ μ»΄ν¬λνΈ |
remarkPlugins | [] | any[] | MDXμ μ λ¬λ Remark νλ¬κ·ΈμΈ |
rehypePlugins | [] | any[] | MDXμ μ λ¬λ Rehype νλ¬κ·ΈμΈ |
beforeDefaultRemarkPlugins | any[] | [] | κΈ°λ³Έ λνμ¬μ°λ£¨μ€ Remark νλ¬κ·ΈμΈλ³΄λ€ λ¨Όμ MDXμ μ λ¬λ μ¬μ©μ μ§μ Remark νλ¬κ·ΈμΈ |
beforeDefaultRehypePlugins | any[] | [] | κΈ°λ³Έ λνμ¬μ°λ£¨μ€ Rehype νλ¬κ·ΈμΈλ³΄λ€ λ¨Όμ MDXμ μ λ¬λ μ¬μ©μ μ§μ Rehype νλ¬κ·ΈμΈ |
μ€μ μμβ
ν리μ μ΅μ μ΄λ νλ¬κ·ΈμΈ μ΅μ μμ νλ¬κ·ΈμΈμ μ€μ ν μ μμ΅λλ€.
λλΆλΆμ λνμ¬μ°λ£¨μ€ μ¬μ©μλ ν리μ μ΅μ μ μ¬μ©ν΄ νλ¬κ·ΈμΈμ μ€μ ν©λλ€.
- 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β
i18n μκ° λ¬Έμλ₯Ό λ¨Όμ νμΈν΄μ£ΌμΈμ.
λ²μ νμΌ μμΉβ
- Base κ²½λ‘:
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