๐ฆ 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.
You can configure this plugin through the preset options.
Configurationโ
์ค์ ํ ์ ์๋ ํ๋
์ต์ ๋ช | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช |
---|---|---|---|
path | string | 'src/pages' | ์ฌ์ด๋ ๋๋ ํ ๋ฆฌ์ ์๋์ ์ธ ํ์ผ ์์คํ ์ ๋ฐ์ดํฐ ๊ฒฝ๋ก์ ๋๋ค. ๋๋ ํ ๋ฆฌ ๋ด ์ปดํฌ๋ํธ๋ ์๋์ผ๋ก ํ์ด์ง๋ก ๋ณํ๋ฉ๋๋ค. |
editUrl | string | EditUrlFn | undefined | Only for Markdown pages. ์ฌ์ดํธ๋ฅผ ํธ์งํ๊ธฐ ์ํ Base URL์
๋๋ค. The final URL is computed by editUrl + relativePostPath . ์ต์
์ฌ์ฉ ์ ๊ฐ ํ์ผ์ ๋ํ ์ธ๋ฐํ ์ ์ด๋ฅผ ํ ์ ์์ต๋๋ค. ํด๋น ํ๋๋ฅผ ์ค์ ํ์ง ์์ผ๋ฉด ํธ์ง ๋งํฌ๊ฐ ๋นํ์ฑํ๋ฉ๋๋ค. |
editLocalizedFiles | boolean | false | Only for Markdown pages. ํธ์ง URL์ ํ์งํ๋์ง ์์ ์๋ณธ ํ์ผ ๋์ ํ์งํ๋ ํ์ผ์ ๋์์ผ๋ก ํฉ๋๋ค. Ignored when editUrl is a function. |
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 ํ๋ฌ๊ทธ์ธ |
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 . |
Typesโ
EditUrlFn
โ
type EditUrlFunction = (params: {
blogDirPath: string;
blogPath: string;
permalink: string;
locale: string;
}) => string | undefined;
Example configurationโ
ํ๋ฆฌ์ ์ต์ ์ด๋ ํ๋ฌ๊ทธ์ธ ์ต์ ์์ ํ๋ฌ๊ทธ์ธ์ ์ค์ ํ ์ ์์ต๋๋ค.
๋๋ถ๋ถ์ ๋ํ์ฌ์ฐ๋ฃจ์ค ์ฌ์ฉ์๋ ํ๋ฆฌ์ ์ต์ ์ ์ฌ์ฉํด ํ๋ฌ๊ทธ์ธ์ ์ค์ ํฉ๋๋ค.
- ํ๋ฆฌ์ ์ต์
- ํ๋ฌ๊ทธ์ธ ์ต์
ํ๋ฆฌ์ ์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ํ๋ฆฌ์ ์ต์ ๋ฅผ ํตํด ํ๋ฌ๊ทธ์ธ์ ๊ตฌ์ฑํฉ๋๋ค.
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: [],
},
},
],
],
};
๋ ๋ฆฝ์ ์ผ๋ก ์คํ๋๋ ํ๋ฌ๊ทธ์ธ์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ์๋ ํ๋ฌ๊ทธ์ธ์ ๋ํ ์ต์ ์ ์ง์ ์ค์ ํ ์ ์์ต๋๋ค.
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 front matterโ
Markdown pages can use the following Markdown front matter metadata fields, enclosed by a line ---
on either side.
์ค์ ํ ์ ์๋ ํ๋
์ต์ ๋ช | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช |
---|---|---|---|
title | string | ๋งํฌ๋ค์ด ํ์ผ | ๋ธ๋ก๊ทธ ๊ฒ์๋ฌผ ์ ๋ชฉ |
description | string | ๋งํฌ๋ค์ด ์ฝํ ์ธ ์ฒซ ๋ฒ์งธ ์ค | The description of your page, which will become the <meta name="description" content="..."/> and <meta property="og:description" content="..."/> in <head> , used by search engines. |
keywords | string[] | undefined | Keywords meta tag, which will become the <meta name="keywords" content="keyword1,keyword2,..."/> in <head> , used by search engines. |
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. |
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
---
Markdown page content
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