π¦ plugin-content-pages
λνμ¬μ°λ£¨μ€μ κΈ°λ³Έ νμ΄μ§ νλ¬κ·ΈμΈμ λλ€. ν΄λμ ν νλ¦Ώμλ κΈ°λ³Έ μ€μ μΌλ‘ νλ¬κ·ΈμΈμ΄ ν¬ν¨λμ΄ μμ΅λλ€. νμ΄μ§ λ§λ€κΈ° κΈ°λ₯μ μ 곡νλ νλ¬κ·ΈμΈμ λλ€.
μ€μΉβ
- npm
- Yarn
- pnpm
- Bun
npm install --save @docusaurus/plugin-content-pages
yarn add @docusaurus/plugin-content-pages
pnpm add @docusaurus/plugin-content-pages
bun add @docusaurus/plugin-content-pages
@docusaurus/preset-classic
μ μ€μΉν κ²½μ°μλ νλ¬κ·ΈμΈμ λ°λ‘ μ€μΉν νμλ μμ΅λλ€.
You can configure this plugin through the preset options.
μ€μ β
μ€μ ν μ μλ νλ
μ΅μ λͺ | νμ | κΈ°λ³Έκ° | μ€λͺ |
---|---|---|---|
path | string | 'src/pages' | μ¬μ΄λ λλ ν 리μ μλμ μΈ νμΌ μμ€ν μ λ°μ΄ν° κ²½λ‘μ λλ€. λλ ν 리 λ΄ μ»΄ν¬λνΈλ μλμΌλ‘ νμ΄μ§λ‘ λ³νλ©λλ€. |
editUrl | string | EditUrlFn | undefined | Only for Markdown pages. μ¬μ΄νΈλ₯Ό νΈμ§νκΈ° μν Base URLμ
λλ€. μ΅μ’
URLμ editUrl + relativePostPath ννλ‘ μ²λ¦¬λ©λλ€. μ΅μ
μ¬μ© μ κ° νμΌμ λν μΈλ°ν μ μ΄λ₯Ό ν μ μμ΅λλ€. ν΄λΉ νλλ₯Ό μ€μ νμ§ μμΌλ©΄ νΈμ§ λ§ν¬κ° λΉνμ±νλ©λλ€. |
editLocalizedFiles | boolean | false | Only for Markdown pages. νΈμ§ URLμ νμ§νλμ§ μμ μλ³Έ νμΌ λμ νμ§νλ νμΌμ λμμΌλ‘ ν©λλ€. editUrl μ΄ ν¨μμΈ κ²½μ°μλ 무μν©λλ€. |
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 νλ¬κ·ΈμΈ |
rehypePlugins | any[] | [] | Recma plugins passed to MDX. |
beforeDefaultRemarkPlugins | any[] | [] | κΈ°λ³Έ λνμ¬μ°λ£¨μ€ Remark νλ¬κ·ΈμΈλ³΄λ€ λ¨Όμ MDXμ μ λ¬λ μ¬μ©μ μ§μ Remark νλ¬κ·ΈμΈ |
beforeDefaultRehypePlugins | any[] | [] | κΈ°λ³Έ λνμ¬μ°λ£¨μ€ Rehype νλ¬κ·ΈμΈλ³΄λ€ λ¨Όμ MDXμ μ λ¬λ μ¬μ©μ μ§μ Rehype νλ¬κ·ΈμΈ |
showLastUpdateAuthor | boolean | false | Only for Markdown pages. Whether to display the author who last updated the page. |
showLastUpdateTime | boolean | false | Only for Markdown pages. Whether to display the last date the page post was updated. This requires access to git history during the build, so will not work correctly with shallow clones (a common default for CI systems). With GitHub actions/checkout , usefetch-depth: 0 . |
νμ β
EditUrlFn
β
type EditUrlFunction = (params: {
blogDirPath: string;
blogPath: string;
permalink: string;
locale: string;
}) => string | undefined;
μ€μ μμβ
ν리μ μ΅μ μ΄λ νλ¬κ·ΈμΈ μ΅μ μμ νλ¬κ·ΈμΈμ μ€μ ν μ μμ΅λλ€.
λλΆλΆμ λνμ¬μ°λ£¨μ€ μ¬μ©μλ ν리μ μ΅μ μ μ¬μ©ν΄ νλ¬κ·ΈμΈμ μ€μ ν©λλ€.
- 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('./my-remark-plugin')],
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('./my-remark-plugin')],
rehypePlugins: [],
beforeDefaultRemarkPlugins: [],
beforeDefaultRehypePlugins: [],
},
],
],
};
λ§ν¬λ€μ΄ νλ°νΈ λ§€ν°β
Markdown pages can use the following Markdown front matter metadata fields, enclosed by a line ---
on either side.
μ€μ ν μ μλ νλ
μ΅μ λͺ | νμ | κΈ°λ³Έκ° | μ€λͺ |
---|---|---|---|
title | string | λ§ν¬λ€μ΄ νμΌ | λΈλ‘κ·Έ κ²μλ¬Ό μ λͺ© |
description | string | λ§ν¬λ€μ΄ μ½ν μΈ μ²« λ²μ§Έ μ€ | νμ΄μ§μ μ€λͺ
μ κ²μμμ§μμ μ¬μ©ν μ μκ² <head> νκ·Έ μμ <meta name="description" content="..."/> μ <meta property="og:description" content="..."/> λ‘ μ²λ¦¬λ©λλ€. |
keywords | string[] | undefined | <head> νκ·Έ λ΄μ <meta name="keywords" content="keyword1,keyword2,..."/> ννλ‘ μμ±λλ ν€μλ λ©ν νκ·Έλ₯Ό μ€μ ν©λλ€. κ²μ μμ§μμ μ¬μ©ν©λλ€. |
image | string | undefined | Cover or thumbnail image that will be used as the <meta property="og:image" content="..."/> in the <head> , enhancing link previews on social media and messaging platforms. |
slug | string | νμΌ κ²½λ‘ | Allows to customize the page URL (/<routeBasePath>/<slug> ). Support multiple patterns: slug: my-page , slug: /my/page , slug: / . |
wrapperClassName | string | νΉμ νμ΄μ§ μ½ν μΈ λ₯Ό νΉμ ν μ μλλ‘ λνΌ μμμ μΆκ°ν ν΄λμ€ μ΄λ¦μ λλ€. | |
hide_table_of_contents | boolean | false | λͺ©μ°¨λ₯Ό μ€λ₯Έμͺ½μΌλ‘ μ¨κΈΈμ§ μ¬λΆ |
draft | boolean | false | λΉκ³΅κ° μ€μ νμ΄μ§λ κ°λ° μνμμλ§ νμΈν μ μμ΅λλ€. |
unlisted | boolean | false | λͺ©λ‘μ μλ νμ΄μ§λ κ°λ° λ° μ ν μνμμ λͺ¨λ νμΈν μ μμ΅λλ€. μ νμμ "μ¨κ²¨μ§" μνλΌ μΈλ±μ€κ° μμ±λμ§ μκ³ μ¬μ΄νΈλ§΅μμ μ μΈλλ©° λ§ν¬ μ 보λ₯Ό μκ³ μλ μ¬μ©μλ§ μ κ·Όν μ μμ΅λλ€. |
μ:
---
title: Markdown Page
description: Markdown page SEO description
wrapperClassName: markdown-page
hide_table_of_contents: false
draft: true
slug: /markdown-page
---
Markdown page content
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