๋ฉ”์ธ ์ปจํ…์ธ ๋กœ ์ด๋™
๋ฒ„์ „: ๋ถˆ์•ˆ์ • ๐Ÿšง

๐Ÿ“ฆ plugin-content-pages

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

์„ค์น˜โ€‹

npm install --save @docusaurus/plugin-content-pages
ํŒ

@docusaurus/preset-classic์„ ์„ค์น˜ํ•œ ๊ฒฝ์šฐ์—๋Š” ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ๋”ฐ๋กœ ์„ค์น˜ํ•  ํ•„์š”๋Š” ์—†์Šต๋‹ˆ๋‹ค.

You can configure this plugin through the preset options.

์„ค์ •โ€‹

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

์˜ต์…˜๋ช…ํƒ€์ž…๊ธฐ๋ณธ๊ฐ’์„ค๋ช…
pathstring'src/pages'์‚ฌ์ด๋“œ ๋””๋ ‰ํ† ๋ฆฌ์— ์ƒ๋Œ€์ ์ธ ํŒŒ์ผ ์‹œ์Šคํ…œ์˜ ๋ฐ์ดํ„ฐ ๊ฒฝ๋กœ์ž…๋‹ˆ๋‹ค. ๋””๋ ‰ํ† ๋ฆฌ ๋‚ด ์ปดํฌ๋„ŒํŠธ๋Š” ์ž๋™์œผ๋กœ ํŽ˜์ด์ง€๋กœ ๋ณ€ํ™˜๋ฉ๋‹ˆ๋‹ค.
editUrlstring | EditUrlFnundefinedOnly for Markdown pages. ์‚ฌ์ดํŠธ๋ฅผ ํŽธ์ง‘ํ•˜๊ธฐ ์œ„ํ•œ Base URL์ž…๋‹ˆ๋‹ค. ์ตœ์ข… URL์€ editUrl + relativePostPath ํ˜•ํƒœ๋กœ ์ฒ˜๋ฆฌ๋ฉ๋‹ˆ๋‹ค. ์˜ต์…˜ ์‚ฌ์šฉ ์‹œ ๊ฐ ํŒŒ์ผ์— ๋Œ€ํ•œ ์„ธ๋ฐ€ํ•œ ์ œ์–ด๋ฅผ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•ด๋‹น ํ•„๋“œ๋ฅผ ์„ค์ •ํ•˜์ง€ ์•Š์œผ๋ฉด ํŽธ์ง‘ ๋งํฌ๊ฐ€ ๋น„ํ™œ์„ฑํ™”๋ฉ๋‹ˆ๋‹ค.
editLocalizedFilesbooleanfalseOnly for Markdown pages. ํŽธ์ง‘ URL์€ ํ˜„์ง€ํ™”๋˜์ง€ ์•Š์€ ์›๋ณธ ํŒŒ์ผ ๋Œ€์‹  ํ˜„์ง€ํ™”๋œ ํŒŒ์ผ์„ ๋Œ€์ƒ์œผ๋กœ ํ•ฉ๋‹ˆ๋‹ค. editUrl์ด ํ•จ์ˆ˜์ธ ๊ฒฝ์šฐ์—๋Š” ๋ฌด์‹œํ•ฉ๋‹ˆ๋‹ค.
routeBasePathstring'/'์‚ฌ์ดํŠธ ํŽ˜์ด์ง€ ์„น์…˜์— ๋Œ€ํ•œ URL ๋ผ์šฐํŠธ ํŠธ๋ ˆ์ผ๋ง ์Šฌ๋ž˜์‹œ๋ฅผ ํฌํ•จํ•˜์ง€ ๋งˆ์„ธ์š”.
includestring[]['**/*.{js,jsx,ts,tsx,md,mdx}']์ผ์น˜ํ•˜๋Š” ํŒŒ์ผ์ด ํฌํ•จ๋˜์–ด ์ฒ˜๋ฆฌ๋ฉ๋‹ˆ๋‹ค.
excludestring[]์„ค์ • ์˜ˆ์‹œ๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”์ผ์น˜ํ•˜๋Š” ํŒŒ์ผ์— ๋Œ€ํ•œ ๋ผ์šฐํŠธ๊ฐ€ ์ƒ์„ฑ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
mdxPageComponentstring'@theme/MDXPage'๊ฐ MDX ํŽ˜์ด์ง€์—์„œ ์‚ฌ์šฉํ•˜๋Š” ์ปดํฌ๋„ŒํŠธ
remarkPlugins[]any[]MDX์— ์ „๋‹ฌ๋œ Remark ํ”Œ๋Ÿฌ๊ทธ์ธ
rehypePlugins[]any[]MDX์— ์ „๋‹ฌ๋œ Rehype ํ”Œ๋Ÿฌ๊ทธ์ธ
rehypePluginsany[][]Recma plugins passed to MDX.
beforeDefaultRemarkPluginsany[][]๊ธฐ๋ณธ ๋„ํ์‚ฌ์šฐ๋ฃจ์Šค Remark ํ”Œ๋Ÿฌ๊ทธ์ธ๋ณด๋‹ค ๋จผ์ € MDX์— ์ „๋‹ฌ๋œ ์‚ฌ์šฉ์ž ์ง€์ • Remark ํ”Œ๋Ÿฌ๊ทธ์ธ
beforeDefaultRehypePluginsany[][]๊ธฐ๋ณธ ๋„ํ์‚ฌ์šฐ๋ฃจ์Šค Rehype ํ”Œ๋Ÿฌ๊ทธ์ธ๋ณด๋‹ค ๋จผ์ € MDX์— ์ „๋‹ฌ๋œ ์‚ฌ์šฉ์ž ์ง€์ • Rehype ํ”Œ๋Ÿฌ๊ทธ์ธ
showLastUpdateAuthorbooleanfalseOnly for Markdown pages. Whether to display the author who last updated the page.
showLastUpdateTimebooleanfalseOnly 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;

์„ค์ • ์˜ˆ์‹œโ€‹

ํ”„๋ฆฌ์…‹ ์˜ต์…˜์ด๋‚˜ ํ”Œ๋Ÿฌ๊ทธ์ธ ์˜ต์…˜์—์„œ ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

ํŒ

๋Œ€๋ถ€๋ถ„์˜ ๋„ํ์‚ฌ์šฐ๋ฃจ์Šค ์‚ฌ์šฉ์ž๋Š” ํ”„๋ฆฌ์…‹ ์˜ต์…˜์„ ์‚ฌ์šฉํ•ด ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

ํ”„๋ฆฌ์…‹์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ ํ”„๋ฆฌ์…‹ ์˜ต์…˜๋ฅผ ํ†ตํ•ด ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

docusaurus.config.js
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: [],
},
},
],
],
};

๋งˆํฌ๋‹ค์šด ํ”„๋ŸฐํŠธ ๋งคํ„ฐโ€‹

Markdown pages can use the following Markdown front matter metadata fields, enclosed by a line --- on either side.

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

์˜ต์…˜๋ช…ํƒ€์ž…๊ธฐ๋ณธ๊ฐ’์„ค๋ช…
titlestring๋งˆํฌ๋‹ค์šด ํŒŒ์ผ๋ธ”๋กœ๊ทธ ๊ฒŒ์‹œ๋ฌผ ์ œ๋ชฉ
descriptionstring๋งˆํฌ๋‹ค์šด ์ฝ˜ํ…์ธ  ์ฒซ ๋ฒˆ์งธ ์ค„ํŽ˜์ด์ง€์˜ ์„ค๋ช…์€ ๊ฒ€์ƒ‰์—”์ง„์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ <head> ํƒœ๊ทธ ์•ˆ์— <meta name="description" content="..."/>์™€ <meta property="og:description" content="..."/>๋กœ ์ฒ˜๋ฆฌ๋ฉ๋‹ˆ๋‹ค.
keywordsstring[]undefined<head> ํƒœ๊ทธ ๋‚ด์— <meta name="keywords" content="keyword1,keyword2,..."/> ํ˜•ํƒœ๋กœ ์ƒ์„ฑ๋˜๋Š” ํ‚ค์›Œ๋“œ ๋ฉ”ํƒ€ ํƒœ๊ทธ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ๊ฒ€์ƒ‰ ์—”์ง„์—์„œ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
imagestringundefinedCover 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.
wrapperClassNamestringํŠน์ • ํŽ˜์ด์ง€ ์ฝ˜ํ…์ธ ๋ฅผ ํŠน์ •ํ•  ์ˆ˜ ์žˆ๋„๋ก ๋ž˜ํผ ์š”์†Œ์— ์ถ”๊ฐ€ํ•  ํด๋ž˜์Šค ์ด๋ฆ„์ž…๋‹ˆ๋‹ค.
hide_table_of_contentsbooleanfalse๋ชฉ์ฐจ๋ฅผ ์˜ค๋ฅธ์ชฝ์œผ๋กœ ์ˆจ๊ธธ์ง€ ์—ฌ๋ถ€
draftbooleanfalse๋น„๊ณต๊ฐœ ์„ค์ • ํŽ˜์ด์ง€๋Š” ๊ฐœ๋ฐœ ์ƒํƒœ์—์„œ๋งŒ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
unlistedbooleanfalse๋ชฉ๋ก์— ์—†๋Š” ํŽ˜์ด์ง€๋Š” ๊ฐœ๋ฐœ ๋ฐ ์ œํ’ˆ ์ƒํƒœ์—์„œ ๋ชจ๋‘ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ œํ’ˆ์—์„œ "์ˆจ๊ฒจ์ง„" ์ƒํƒœ๋ผ ์ธ๋ฑ์Šค๊ฐ€ ์ƒ์„ฑ๋˜์ง€ ์•Š๊ณ  ์‚ฌ์ดํŠธ๋งต์—์„œ ์ œ์™ธ๋˜๋ฉฐ ๋งํฌ ์ •๋ณด๋ฅผ ์•Œ๊ณ  ์žˆ๋Š” ์‚ฌ์šฉ์ž๋งŒ ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์˜ˆ:

---
title: Markdown Page
description: Markdown page SEO description
wrapperClassName: markdown-page
hide_table_of_contents: false
draft: true
---

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