본문으둜 κ±΄λ„ˆλ›°κΈ°
버전: Canary 🚧

πŸ“¦ 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;

μ„€μ • μ˜ˆμ‹œβ€‹

프리셋 μ˜΅μ…˜μ΄λ‚˜ ν”ŒλŸ¬κ·ΈμΈ μ˜΅μ…˜μ—μ„œ ν”ŒλŸ¬κ·ΈμΈμ„ μ„€μ •ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

팁

λŒ€λΆ€λΆ„μ˜ λ„νμ‚¬μš°λ£¨μŠ€ μ‚¬μš©μžλŠ” 프리셋 μ˜΅μ…˜μ„ μ‚¬μš©ν•΄ ν”ŒλŸ¬κ·ΈμΈμ„ μ„€μ •ν•©λ‹ˆλ‹€.

If you use a preset, configure this plugin through the preset options:

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.
slugstring파일 경둜Allows to customize the page URL (/<routeBasePath>/<slug>). Support multiple patterns: slug: my-page, slug: /my/page, slug: /.
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
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