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

๐Ÿ“ฆ plugin-content-blog

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

some features production only

ํ”ผ๋“œ ๊ธฐ๋Šฅ์€ ๋นŒ๋“œ ์‚ฐ์ถœ๋ฌผ์—์„œ๋งŒ ์ž‘๋™ํ•˜๋ฉฐ ์ œํ’ˆ ๋ฒ„์ „์—์„œ๋งŒ ํ™œ์„ฑํ™”๋ฉ๋‹ˆ๋‹ค.

์„ค์น˜โ€‹

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

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

You can configure this plugin through the preset options.

์„ค์ •โ€‹

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

์˜ต์…˜๋ช…ํƒ€์ž…๊ธฐ๋ณธ๊ฐ’์„ค๋ช…
pathstring'blog'์‚ฌ์ดํŠธ ๋””๋ ‰ํ† ๋ฆฌ์— ์ƒ๋Œ€์ ์ธ ํŒŒ์ผ ์‹œ์Šคํ…œ์˜ ๋ธ”๋กœ๊ทธ ์ฝ˜ํ…์ธ  ๋””๋ ‰ํ† ๋ฆฌ ๊ฒฝ๋กœ์ž…๋‹ˆ๋‹ค.
editUrlstring | EditUrlFnundefined์‚ฌ์ดํŠธ๋ฅผ ํŽธ์ง‘ํ•˜๊ธฐ ์œ„ํ•œ Base URL์ž…๋‹ˆ๋‹ค. ์ตœ์ข… URL์€ editUrl + relativePostPath ํ˜•ํƒœ๋กœ ์ฒ˜๋ฆฌ๋ฉ๋‹ˆ๋‹ค. ์˜ต์…˜ ์‚ฌ์šฉ ์‹œ ๊ฐ ํŒŒ์ผ์— ๋Œ€ํ•œ ์„ธ๋ฐ€ํ•œ ์ œ์–ด๋ฅผ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•ด๋‹น ํ•„๋“œ๋ฅผ ์„ค์ •ํ•˜์ง€ ์•Š์œผ๋ฉด ํŽธ์ง‘ ๋งํฌ๊ฐ€ ๋น„ํ™œ์„ฑํ™”๋ฉ๋‹ˆ๋‹ค.
editLocalizedFilesbooleanfalseํŽธ์ง‘ URL์€ ํ˜„์ง€ํ™”๋˜์ง€ ์•Š์€ ์›๋ณธ ํŒŒ์ผ ๋Œ€์‹  ํ˜„์ง€ํ™”๋œ ํŒŒ์ผ์„ ๋Œ€์ƒ์œผ๋กœ ํ•ฉ๋‹ˆ๋‹ค. editUrl์ด ํ•จ์ˆ˜์ธ ๊ฒฝ์šฐ์—๋Š” ๋ฌด์‹œํ•ฉ๋‹ˆ๋‹ค.
blogTitlestring'Blog'๋” ๋‚˜์€ SEO๋ฅผ ์œ„ํ•œ ๋ธ”๋กœ๊ทธ ํŽ˜์ด์ง€ ์ œ๋ชฉ
blogDescriptionstring'Blog'๋” ๋‚˜์€ SEO๋ฅผ ์œ„ํ•œ ๋ธ”๋กœ๊ทธ ํŽ˜์ด์ง€ ๋ฉ”ํƒ€ ์„ค๋ช…
blogSidebarCountnumber | 'ALL'5๋ธ”๋กœ๊ทธ ์‚ฌ์ด๋“œ๋ฐ”์— ํ‘œ์‹œํ•  ๋ธ”๋กœ๊ทธ ๊ฒŒ์‹œ๋ฌผ ์ˆ˜์ž…๋‹ˆ๋‹ค. ๋ชจ๋“  ๋ธ”๋กœ๊ทธ ๊ฒŒ์‹œ๋ฌผ์„ ํ‘œ์‹œํ•˜๋ ค๋ฉด 'ALL', ๊ฐ์ถ”๋ ค๋ฉด 0
blogSidebarTitlestring'Recent posts'๋ธ”๋กœ๊ทธ ์‚ฌ์ด๋“œ๋ฐ” ์ œ๋ชฉ
routeBasePathstring'blog'์‚ฌ์ดํŠธ ๋ธ”๋กœ๊ทธ ์„น์…˜์— ๋Œ€ํ•œ URL ๋ผ์šฐํŠธ ํŠธ๋ ˆ์ผ๋ง ์Šฌ๋ž˜์‹œ๋ฅผ ํฌํ•จํ•˜์ง€ ๋งˆ์„ธ์š”. ๋ธ”๋กœ๊ทธ๋ฅผ ๋ฃจํŠธ ๊ฒฝ๋กœ๋กœ ์„ค์ •ํ•  ๋•Œ๋งŒ /๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
tagsBasePathstring'tags'๋ธ”๋กœ๊ทธ ํƒœ๊ทธ ์„น์…˜์— ๋Œ€ํ•œ URL ๋ผ์šฐํŠธ routeBasePath์— ์ถ”๊ฐ€๋ฉ๋‹ˆ๋‹ค.
pageBasePathstring'page'URL route for the pages section of your blog. routeBasePath์— ์ถ”๊ฐ€๋ฉ๋‹ˆ๋‹ค.
archiveBasePathstring | null'archive'๋ธ”๋กœ๊ทธ ์•„์นด์ด๋ธŒ ์„น์…˜์— ๋Œ€ํ•œ URL ๋ผ์šฐํŠธ routeBasePath์— ์ถ”๊ฐ€๋ฉ๋‹ˆ๋‹ค. ํŠธ๋ ˆ์ผ๋ง ์Šฌ๋ž˜์‹œ๋ฅผ ํฌํ•จํ•˜์ง€ ๋งˆ์„ธ์š”. ์•„์นด์ด๋ธŒ ์ƒ์„ฑ์„ ํ•˜์ง€ ์•Š์œผ๋ ค๋ฉด null๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
authorsBasePathstring'authors'URL route for the authors pages of your blog. Will be appended to path.
includestring[]['**/*.{md,mdx}']์ฝ˜ํ…์ธ  ๊ฒฝ๋กœ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๋นŒ๋“œํ•  ๋งˆํฌ๋‹ค์šด ํŒŒ์ผ๊ณผ ์ผ์น˜ํ•˜๋Š” glob ํŒจํ„ด ๋ฐฐ์—ด์ž…๋‹ˆ๋‹ค.
excludestring[]์„ค์ • ์˜ˆ์‹œ๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”์ œ์™ธํ•  ๋งˆํฌ๋‹ค์šด ํŒŒ์ผ๊ณผ ์ผ์น˜ํ•˜๋Š” glob ํŒจํ„ด ๋ฐฐ์—ด์ž…๋‹ˆ๋‹ค. include ์˜ต์…˜์„ ์ข€ ๋” ์„ธ๋ถ„ํ™”ํ•˜๋Š” ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค.
postsPerPagenumber | 'ALL'10๋ชฉ๋ก ํŽ˜์ด์ง€์—์„œ ํŽ˜์ด์ง€ ๋‹น ํ‘œ์‹œํ•  ๊ฒŒ์‹œ๋ฌผ ์ˆ˜์ž…๋‹ˆ๋‹ค. ํ•˜๋‚˜์˜ ๋ชฉ๋ก ํŽ˜์ด์ง€์— ๋ชจ๋“  ๊ฒŒ์‹œ๋ฌผ์„ ํ‘œ์‹œํ•˜๋ ค๋ฉด 'ALL'์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
blogListComponentstring'@theme/BlogListPage'๋ธ”๋กœ๊ทธ ๋ชฉ๋ก ํŽ˜์ด์ง€์˜ ๋ฃจํŠธ ์ปดํฌ๋„ŒํŠธ
blogPostComponentstring'@theme/BlogPostPage'๊ฐ ๋ธ”๋กœ๊ทธ ๊ฒŒ์‹œ๋ฌผ ํŽ˜์ด์ง€์˜ ๋ฃจํŠธ ์ปดํฌ๋„ŒํŠธ
blogTagsListComponentstring'@theme/BlogTagsListPage'ํƒœ๊ทธ ๋ชฉ๋ก ํŽ˜์ด์ง€์˜ ๋ฃจํŠธ ์ปดํฌ๋„ŒํŠธ
blogTagsPostsComponentstring'@theme/BlogTagsPostsPage'"ํƒœ๊ทธ๋ฅผ ํฌํ•จํ•œ ๊ฒŒ์‹œ๋ฌผ" ํŽ˜์ด์ง€์˜ ๋ฃจํŠธ ์ปดํฌ๋„ŒํŠธ
blogArchiveComponentstring'@theme/BlogArchivePage'๋ธ”๋กœ๊ทธ ์•„์นด์ด๋ธŒ ํŽ˜์ด์ง€์˜ ๋ฃจํŠธ ์ปดํฌ๋„ŒํŠธ
blogAuthorsPostsComponentstring'@theme/Blog/Pages/BlogAuthorsPostsPage'Root component of the blog author page.
blogAuthorsListComponentstring'@theme/Blog/Pages/BlogAuthorsListPage'Root component of the blog authors page index.
remarkPluginsany[][]MDX์— ์ „๋‹ฌ๋œ Remark ํ”Œ๋Ÿฌ๊ทธ์ธ
rehypePluginsany[][]MDX์— ์ „๋‹ฌ๋œ Rehype ํ”Œ๋Ÿฌ๊ทธ์ธ
rehypePluginsany[][]Recma plugins passed to MDX.
beforeDefaultRemarkPluginsany[][]๊ธฐ๋ณธ ๋„ํ์‚ฌ์šฐ๋ฃจ์Šค Remark ํ”Œ๋Ÿฌ๊ทธ์ธ๋ณด๋‹ค ๋จผ์ € MDX์— ์ „๋‹ฌ๋œ ์‚ฌ์šฉ์ž ์ง€์ • Remark ํ”Œ๋Ÿฌ๊ทธ์ธ
beforeDefaultRehypePluginsany[][]๊ธฐ๋ณธ ๋„ํ์‚ฌ์šฐ๋ฃจ์Šค Rehype ํ”Œ๋Ÿฌ๊ทธ์ธ๋ณด๋‹ค ๋จผ์ € MDX์— ์ „๋‹ฌ๋œ ์‚ฌ์šฉ์ž ์ง€์ • Rehype ํ”Œ๋Ÿฌ๊ทธ์ธ
truncateMarkerRegExp/<!--\s*truncate\s*-->/ \\{\/\*\s*truncate\s*\*\/\}/
showReadingTimebooleantrue๋ธ”๋กœ๊ทธ ๊ฒŒ์‹œ๋ฌผ์˜ ์˜ˆ์ƒ ์ฝ๊ธฐ ์‹œ๊ฐ„์„ ํ‘œ์‹œ
readingTimeReadingTimeFn๊ธฐ๋ณธ ์ฝ๊ธฐ ์‹œ๊ฐ„ํ‘œ์‹œ๋˜๋Š” ์ฝ๊ธฐ ์‹œ๊ฐ„ ์ˆซ์ž๋ฅผ ์‚ฌ์šฉ์ž ์ง€์ •ํ•˜๊ธฐ ์œ„ํ•œ ์ฝœ๋ฐฑ
authorsMapPathstring'authors.yml'๋ธ”๋กœ๊ทธ ์ฝ˜ํ…์ธ  ๋””๋ ‰ํ† ๋ฆฌ์— ์ƒ๋Œ€์ ์ธ ์ž‘์„ฑ์ž ๋งต ํŒŒ์ผ ๊ฒฝ๋กœ
feedOptions์•„๋ž˜๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.{type: ['rss', 'atom']}๋ธ”๋กœ๊ทธ ํ”ผ๋“œ
feedOptions.typeFeedType | FeedType[] | 'all' | nullํ•„์ˆ˜์ƒ์„ฑํ•  ํ”ผ๋“œ ์œ ํ˜•์ž…๋‹ˆ๋‹ค. ์ƒ์„ฑ์„ ํ•˜์ง€ ์•Š์œผ๋ ค๋ฉด null๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
feedOptions.createFeedItemsCreateFeedItemsFn | undefinedundefinedํ”ผ๋“œ ํ•ญ๋ชฉ์„ ๋ณ€ํ™˜ํ•˜๊ฑฐ๋‚˜ ํ•„ํ„ฐ๋งํ•  ๋•Œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ์„ ํƒ ๊ธฐ๋Šฅ
feedOptions.limitnumber | null | false20Limits the feed to the specified number of posts, false or null for all entries. Defaults to 20.
feedOptions.titlestringsiteConfig.titleํ”ผ๋“œ ์ œ๋ชฉ
feedOptions.descriptionstring`${siteConfig.title} Blog`ํ”ผ๋“œ ์„ค๋ช…
feedOptions.copyrightstringundefined์ €์ž‘๊ถŒ ๋ฌธ๊ตฌ
feedOptions.xsltboolean | FeedXSLTOptionsundefinedPermits to style the blog XML feeds with XSLT so that browsers render them nicely.
feedOptions.languagestring (์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๊ฐ’์€ ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ )undefinedํ”ผ๋“œ ์–ธ์–ด ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ
sortPosts'descending' | 'ascending' 'descending'๋ธ”๋กœ๊ทธ ๊ฒŒ์‹œ๋ฌผ ์ •๋ ฌ ์ˆœ์„œ ์„ค์ •
processBlogPostsProcessBlogPostsFnundefinedAn optional function which can be used to transform blog posts (filter, modify, delete, etc...).
showLastUpdateAuthorbooleanfalseWhether to display the author who last updated the blog post.
showLastUpdateTimebooleanfalseWhether to display the last date the blog 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.
tagsstring | false | null | undefinedtags.ymlPath to the YAML tags file listing pre-defined tags. Relative to the blog content directory.
onInlineTags'ignore' | 'log' | 'warn' | 'throw'warnThe plugin behavior when blog posts contain inline tags (not appearing in the list of pre-defined tags, usually tags.yml).
onUntruncatedBlogPosts'ignore' | 'log' | 'warn' | 'throw'warnThe plugin behavior when blog posts do not contain a truncate marker.

ํƒ€์ž…โ€‹

EditUrlFnโ€‹

type EditUrlFunction = (params: {
blogDirPath: string;
blogPath: string;
permalink: string;
locale: string;
}) => string | undefined;

ReadingTimeFnโ€‹

type ReadingTimeOptions = {
wordsPerMinute: number;
wordBound: (char: string) => boolean;
};

type ReadingTimeCalculator = (params: {
content: string;
frontMatter?: BlogPostFrontMatter & Record<string, unknown>;
options?: ReadingTimeOptions;
}) => number;

type ReadingTimeFn = (params: {
content: string;
frontMatter: BlogPostFrontMatter & Record<string, unknown>;
defaultReadingTime: ReadingTimeCalculator;
}) => number | undefined;

FeedTypeโ€‹

type FeedType = 'rss' | 'atom' | 'json';

FeedXSLTOptionsโ€‹

Permits to style the blog XML feeds so that browsers render them nicely with XSLT.

  • Use true to let the blog use its built-in .xsl and .css files to style the blog feed
  • Use a falsy value (undefined | null | false) to disable the feature
  • Use a string to provide a file path to a custom .xsl file relative to the blog content folder. By convention, you must provide a .css file with the exact same name.
type FeedXSLTOptions =
| boolean
| undefined
| null
| {
rss?: string | boolean | null | undefined;
atom?: string | boolean | null | undefined;
};

CreateFeedItemsFnโ€‹

type CreateFeedItemsFn = (params: {
blogPosts: BlogPost[];
siteConfig: DocusaurusConfig;
outDir: string;
defaultCreateFeedItemsFn: CreateFeedItemsFn;
}) => Promise<BlogFeedItem[]>;

ProcessBlogPostsFnโ€‹

type ProcessBlogPostsFn = (params: {
blogPosts: BlogPost[];
}) => Promise<void | BlogPost[]>;

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

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

ํŒ

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

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

docusaurus.config.js
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
blog: {
path: 'blog',
// Simple use-case: string editUrl
// editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
// Advanced use-case: functional editUrl
editUrl: ({locale, blogDirPath, blogPath, permalink}) =>
`https://github.com/facebook/docusaurus/edit/main/website/${blogDirPath}/${blogPath}`,
editLocalizedFiles: false,
blogTitle: 'Blog title',
blogDescription: 'Blog',
blogSidebarCount: 5,
blogSidebarTitle: 'All our posts',
routeBasePath: 'blog',
include: ['**/*.{md,mdx}'],
exclude: [
'**/_*.{js,jsx,ts,tsx,md,mdx}',
'**/_*/**',
'**/*.test.{js,jsx,ts,tsx}',
'**/__tests__/**',
],
postsPerPage: 10,
blogListComponent: '@theme/BlogListPage',
blogPostComponent: '@theme/BlogPostPage',
blogTagsListComponent: '@theme/BlogTagsListPage',
blogTagsPostsComponent: '@theme/BlogTagsPostsPage',
remarkPlugins: [require('./my-remark-plugin')],
rehypePlugins: [],
beforeDefaultRemarkPlugins: [],
beforeDefaultRehypePlugins: [],
truncateMarker: /<!--\s*(truncate)\s*-->/,
showReadingTime: true,
feedOptions: {
type: '',
title: '',
description: '',
copyright: '',
language: undefined,
createFeedItems: async (params) => {
const {blogPosts, defaultCreateFeedItems, ...rest} = params;
return defaultCreateFeedItems({
// keep only the 10 most recent blog posts in the feed
blogPosts: blogPosts.filter((item, index) => index < 10),
...rest,
});
},
},
},
},
],
],
};

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

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

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

์˜ต์…˜๋ช…ํƒ€์ž…๊ธฐ๋ณธ๊ฐ’์„ค๋ช…
authorsAuthorsundefined๋ธ”๋กœ๊ทธ ๊ฒŒ์‹œ๋ฌผ ์ž‘์„ฑ์ž๋“ค(๋˜๋Š” ๋‹จ๋… ์ž‘์„ฑ์ž) ๋ชฉ๋ก ์ž์„ธํ•œ ์„ค๋ช…์€ authors ๊ฐ€์ด๋“œ๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”. ๋ธ”๋กœ๊ทธ ๊ฒŒ์‹œ๋ฌผ ์ž‘์„ฑ์ž๊ฐ€ ํ•œ ๋ช…์ธ ๊ฒฝ์šฐ์—๋„ author_*๋ณด๋‹ค๋Š” authors๋ฅผ ํ”„๋ŸฐํŠธ ๋งคํ„ฐ ํ•„๋“œ๋กœ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.
authorstringundefinedโš ๏ธ authors ์‚ฌ์šฉ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค. ๋ธ”๋กœ๊ทธ ๊ฒŒ์‹œ๋ฌผ ์ž‘์„ฑ์ž ์ด๋ฆ„์ž…๋‹ˆ๋‹ค.
author_urlstringundefinedโš ๏ธ authors ์‚ฌ์šฉ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค. ์ž‘์„ฑ์ž ์ด๋ฆ„์— ๋งํฌ๋กœ ์—ฐ๊ฒฐ๋  URL์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. This could be a GitHub, X, Facebook profile URL, etc.
author_image_urlstringundefinedโš ๏ธ authors ์‚ฌ์šฉ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค. ์ž‘์„ฑ์ž ์ธ๋„ค์ผ ์ด๋ฏธ์ง€ URL์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
author_titlestringundefinedโš ๏ธ authors ์‚ฌ์šฉ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค. ์ž‘์„ฑ์ž์— ๋Œ€ํ•œ ์„ค๋ช…์ž…๋‹ˆ๋‹ค.
titlestring๋งˆํฌ๋‹ค์šด ํŒŒ์ผ๋ธ”๋กœ๊ทธ ๊ฒŒ์‹œ๋ฌผ ์ œ๋ชฉ
datestringํŒŒ์ผ๋ช… ๋˜๋Š” ํŒŒ์ผ ์ƒ์„ฑ ์‹œ๊ฐ„๋ธ”๋กœ๊ทธ ๊ฒŒ์‹œ๋ฌผ ์ƒ์„ฑ ์‹œ๊ฐ„. ํ•ด๋‹น ํ•„๋“œ๋ฅผ ์„ค์ •ํ•˜์ง€ ์•Š์œผ๋ฉด ํŒŒ์ผ ๋˜๋Š” ํด๋”๋ช…์—์„œ ์ถ”์ถœํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์€ ํ˜•์‹์ž…๋‹ˆ๋‹ค. 2021-04-15-blog-post.mdx, 2021-04-15-blog-post/index.mdx, 2021/04/15/blog-post.mdx. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ๋งˆํฌ๋‹ค์šด ํŒŒ์ผ์„ ์ƒ์„ฑํ•œ ์‹œ๊ฐ„์œผ๋กœ ์„ค์ •๋ฉ๋‹ˆ๋‹ค.
tagsTag[]undefinedํฌ์ŠคํŠธ๋ฅผ ํƒœ๊ทธํ•˜๊ธฐ ์œ„ํ•œ ๋ฌธ์ž์—ด ๋˜๋Š” ์˜ค๋ธŒ์ ํŠธ์˜ ๋ชฉ๋ก์ž…๋‹ˆ๋‹ค. label๊ณผ permalink 2๊ฐœ์˜ ํ•„๋“œ๋กœ ๊ตฌ์„ฑ๋ฉ๋‹ˆ๋‹ค. Strings can be a reference to keys of a tags file (usually tags.yml)
draftbooleanfalse๋น„๊ณต๊ฐœ ์„ค์ • ๊ฒŒ์‹œ๋ฌผ์€ ๊ฐœ๋ฐœ ์ƒํƒœ์—์„œ๋งŒ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
unlistedbooleanfalse๋ชฉ๋ก์— ์—†๋Š” ๋ธ”๋กœ๊ทธ ๊ฒŒ์‹œ๋ฌผ์€ ๊ฐœ๋ฐœ ๋ฐ ์ œํ’ˆ ์ƒํƒœ์—์„œ ๋ชจ๋‘ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ œํ’ˆ์—์„œ "์ˆจ๊ฒจ์ง„" ์ƒํƒœ๋ผ ์ธ๋ฑ์Šค๊ฐ€ ์ƒ์„ฑ๋˜์ง€ ์•Š๊ณ  ์‚ฌ์ดํŠธ๋งต์—์„œ ์ œ์™ธ๋˜๋ฉฐ ๋งํฌ ์ •๋ณด๋ฅผ ์•Œ๊ณ  ์žˆ๋Š” ์‚ฌ์šฉ์ž๋งŒ ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
hide_table_of_contentsbooleanfalse๋ชฉ์ฐจ๋ฅผ ์˜ค๋ฅธ์ชฝ์œผ๋กœ ์ˆจ๊ธธ์ง€ ์—ฌ๋ถ€
toc_min_heading_levelnumber2๋ชฉ์ฐจ์— ํ‘œ์‹œ๋˜๋Š” ์ตœ์†Œ ์ œ๋ชฉ ์ˆ˜์ค€์ž…๋‹ˆ๋‹ค. 2์—์„œ 6 ์‚ฌ์ด์˜ ๊ฐ’์œผ๋กœ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๊ณ  ์ตœ๋Œ“๊ฐ’๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค.
toc_max_heading_levelnumber3๋ชฉ์ฐจ์— ํ‘œ์‹œ๋˜๋Š” ์ตœ๋Œ€ ์ œ๋ชฉ ์ˆ˜์ค€์ž…๋‹ˆ๋‹ค. 2์—์„œ 6 ์‚ฌ์ด์˜ ๊ฐ’์œผ๋กœ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
keywordsstring[]undefined<head> ํƒœ๊ทธ ๋‚ด์— <meta name="keywords" content="keyword1,keyword2,..."/> ํ˜•ํƒœ๋กœ ์ƒ์„ฑ๋˜๋Š” ํ‚ค์›Œ๋“œ ๋ฉ”ํƒ€ ํƒœ๊ทธ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ๊ฒ€์ƒ‰ ์—”์ง„์—์„œ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
descriptionstring๋งˆํฌ๋‹ค์šด ์ฝ˜ํ…์ธ  ์ฒซ ๋ฒˆ์งธ ์ค„๋ฌธ์„œ์˜ ์„ค๋ช…์€ ๊ฒ€์ƒ‰์—”์ง„์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ <head> ํƒœ๊ทธ ์•ˆ์— <meta name="description" content="..."/>์™€ <meta property="og:description" content="..."/>๋กœ ์ฒ˜๋ฆฌ๋ฉ๋‹ˆ๋‹ค.
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ํŒŒ์ผ ๊ฒฝ๋กœ๋ธ”๋กœ๊ทธ ํฌ์ŠคํŠธ URL์„ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ๋„๋ก ํ—ˆ์šฉํ•ฉ๋‹ˆ๋‹ค(/<routeBasePath>/<slug>). ์—ฌ๋Ÿฌ ํŒจํ„ด์„ ์„ค์ •ํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค: slug: my-blog-post, slug: /my/path/to/blog/post, slug: /.
last_updateFrontMatterLastUpdateundefinedAllows overriding the last update author/date. ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๋‚ ์งœ ํ˜•์‹์€ parsable date string์„ ์ฐธ๊ณ ํ•˜์„ธ์š”.
type FrontMatterLastUpdate = {date?: string; author?: string};

type Tag = string | {label: string; permalink: string};

// An author key references an author from the global plugin authors.yml file
type AuthorKey = string;

// Social platform name -> Social platform link
// Example: {MyPlatform: 'https://myplatform.com/myusername'}
// Pre-defined platforms ("x", "github", "twitter", "linkedin", "stackoverflow") accept handles:
// Example: {github: 'slorber'}
type AuthorSocials = Record<string, string>;

type Author = {
key?: AuthorKey;
name: string;
title?: string;
url?: string;
image_url?: string;
socials?: AuthorSocials;
};

// The front matter authors field allows various possible shapes
type Authors = AuthorKey | Author | (AuthorKey | Author)[];

์˜ˆ:

---
title: Welcome Docusaurus
authors:
- slorber
- yangshun
- name: Joel Marcey
title: Co-creator of Docusaurus 1
url: https://github.com/JoelMarcey
image_url: https://github.com/JoelMarcey.png
socials:
x: joelmarcey
github: JoelMarcey
tags: [docusaurus]
description: This is my first post on Docusaurus.
image: https://i.imgur.com/mErPwqL.png
hide_table_of_contents: false
---

A Markdown blog post

Tags Fileโ€‹

Use the tags plugin option to configure the path of a YAML tags file.

By convention, the plugin will look for a tags.yml file at the root of your content folder(s).

This file can contain a list of predefined tags. You can reference these tags by their keys in Markdown files thanks to the tags front matter.

Keeping tags consistent

Using a tags file, you can ensure that your tags usage is consistent across your plugin content set. Use the onInlineTags: 'throw' plugin option to enforce this consistency and prevent usage of inline tags declared on the fly.

Typesโ€‹

The YAML content of the provided tags file should respect the following shape:

type Tag = {
label?: string; // Tag display label
permalink?: string; // Tag URL pathname segment
description?: string; // Tag description displayed in the tag page
};

type TagsFileInput = Record<string, Partial<Tag> | null>;

Exampleโ€‹

tags.yml
releases:
label: 'Product releases'
permalink: '/product-releases'
description: 'Content related to product releases.'

# A partial tag definition is also valid
announcements:
label: 'Announcements'

# An empty tag definition is also valid
# Other attributes will be inferred from the key
emptyTag:
content.md
---
tags: [releases, announcements, emptyTag]
---

# Title

Content

Authors Fileโ€‹

Use the authors plugin option to configure the path of a YAML authors file.

By convention, the plugin will look for a authors.yml file at the root of your blog content folder(s).

This file can contain a list of predefined global blog authors. You can reference these authors by their keys in Markdown files thanks to the authors front matter.

ํƒ€์ž…โ€‹

The YAML content of the provided authors file should respect the following shape:

type AuthorsMapInput = {
[authorKey: string]: AuthorInput;
};

type AuthorInput = {
name?: string;
title?: string;
description?: string;
imageURL?: string;
url?: string;
email?: string;
page?: boolean | {permalink: string};
socials?: Record<string, string>;
[customAuthorAttribute: string]: unknown;
};

์˜ˆโ€‹

tags.yml
slorber:
name: Sรฉbastien Lorber
title: Docusaurus maintainer
url: https://sebastienlorber.com
image_url: https://github.com/slorber.png
page: true
socials:
x: sebastienlorber
github: slorber

jmarcey:
name: Joel Marcey
title: Co-creator of Docusaurus 1
url: https://github.com/JoelMarcey
image_url: https://github.com/JoelMarcey.png
email: [email protected]
page:
permalink: '/joel-marcey'
socials:
x: joelmarcey
github: JoelMarcey
blog/my-blog-post.md
---
authors: [slorber, jmarcey]
---

# My Blog Post

Content

i18nโ€‹

i18n ์†Œ๊ฐœ ๋ฌธ์„œ๋ฅผ ๋จผ์ € ํ™•์ธํ•ด์ฃผ์„ธ์š”.

๋ฒˆ์—ญ ํŒŒ์ผ ์œ„์น˜โ€‹

  • Base path: website/i18n/[locale]/docusaurus-plugin-content-blog
  • Multi-instance path: website/i18n/[locale]/docusaurus-plugin-content-blog-[pluginId]
  • JSON ํŒŒ์ผ: docusaurus write-translations ๋ช…๋ น ์‹คํ–‰ ํ›„ ๋งŒ๋“ค์–ด์ง„ ํŒŒ์ผ
  • Markdown files: website/i18n/[locale]/docusaurus-plugin-content-blog

ํŒŒ์ผ ์‹œ์Šคํ…œ ๊ตฌ์กฐ ์˜ˆโ€‹

website/i18n/[locale]/docusaurus-plugin-content-blog
โ”‚
โ”‚ # website/blog์— ๋Œ€ํ•œ ๋ฒˆ์—ญ
โ”œโ”€โ”€ authors.yml
โ”œโ”€โ”€ first-blog-post.md
โ”œโ”€โ”€ second-blog-post.md
โ”‚
โ”‚ # ๋ Œ๋”๋ง๋  ํ”Œ๋Ÿฌ๊ทธ์ธ ์˜ต์…˜์— ๋Œ€ํ•œ ๋ฒˆ์—ญ
โ””โ”€โ”€ options.json