๐ฆ plugin-content-blog
๋ธ๋ก๊ทธ ๋ง๋ค๊ธฐ ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ ๋ํ์ฌ์ฐ๋ฃจ์ค์ ๊ธฐ๋ณธ ๋ธ๋ก๊ทธ ํ๋ฌ๊ทธ์ธ์ ๋๋ค.
some features production only
The feed feature works by extracting the build output, and is only active in production.
์ค์นโ
- npm
- Yarn
npm install --save @docusaurus/plugin-content-blog
yarn add @docusaurus/plugin-content-blog
tip
@docusaurus/preset-classic
์ ์ค์นํ ๊ฒฝ์ฐ์๋ ํ๋ฌ๊ทธ์ธ์ ๋ฐ๋ก ์ค์นํ ํ์๋ ์์ต๋๋ค.
ํ๋ฆฌ์ ์ต์ ์์ ํ๋ฌ๊ทธ์ธ์ ์ค์ ํ ์ ์์ต๋๋ค.
์ค์ โ
์ค์ ํ ์ ์๋ ํ๋
Name | Type | Default | Description |
---|---|---|---|
path | string | 'blog' | Path to the blog content directory on the file system, relative to site dir. |
editUrl | !!crwdBlockTags_275_sgaTkcolBdwrc!! | undefined | ์ฌ์ดํธ๋ฅผ ํธ์งํ๊ธฐ ์ํ ๊ธฐ๋ณธ URL์
๋๋ค. The final URL is computed by editUrl + relativePostPath . ์ต์
์ฌ์ฉ ์ ๊ฐ ํ์ผ์ ๋ํ ์ธ๋ฐํ ์ ์ด๋ฅผ ํ ์ ์์ต๋๋ค. ํด๋น ํ๋๋ฅผ ์ค์ ํ์ง ์์ผ๋ฉด ํธ์ง ๋งํฌ๊ฐ ๋นํ์ฑํ๋ฉ๋๋ค. |
editLocalizedFiles | boolean | false | ํธ์ง URL์ด ์๋ณธ ํ์ผ ๋์ ํ์งํ๋ ํ์ผ์ ๋์์ผ๋ก ์ฒ๋ฆฌ๋๋๋ก ํฉ๋๋ค. editUrl ์ด ํจ์์ธ ๊ฒฝ์ฐ์๋ ๋ฌด์ํฉ๋๋ค. |
blogTitle | string | 'Blog' | ๋ ๋์ SEO๋ฅผ ์ํด ๋ธ๋ก๊ทธ ํ์ด์ง ์ ๋ชฉ์ ์ค์ ํฉ๋๋ค. |
blogDescription | string | 'Blog' | ๋ ๋์ SEO๋ฅผ ์ํด ๋ธ๋ก๊ทธ ํ์ด์ง ๋ฉํ ์ค๋ช ์ ์ค์ ํฉ๋๋ค. |
blogSidebarCount | !!crwdBlockTags_276_sgaTkcolBdwrc!! | 5 | ๋ธ๋ก๊ทธ ์ฌ์ด๋๋ฐ์ ํ์ํ ๋ธ๋ก๊ทธ ๊ฒ์๋ฌผ ์์
๋๋ค. 'ALL' to show all blog posts; 0 to disable. |
blogSidebarTitle | string | 'Recent posts' | Title of the blog sidebar. |
routeBasePath | string | 'blog' | ์ฌ์ดํธ์์ ์ ๊ณตํ๋ ๋ธ๋ก๊ทธ์ ๋ํ URL ๊ฒฝ๋ก์
๋๋ค. ์ ๋ URL ๋์ ์ฌ๋์๋ฅผ ๋ถ์ด์ง ๋ง์ธ์. ๋ธ๋ก๊ทธ๋ฅผ ๋ฃจํธ ๊ฒฝ๋ก๋ก ์ค์ ํ ๋๋ง / ๋ฅผ ์ฌ์ฉํฉ๋๋ค. |
tagsBasePath | string | 'tags' | URL route for the tags section of your blog. Will be appended to routeBasePath . ์ ๋ URL ๋์ ์ฌ๋์๋ฅผ ๋ถ์ด์ง ๋ง์ธ์. |
archiveBasePath | !!crwdBlockTags_277_sgaTkcolBdwrc!! | 'archive' | URL route for the archive section of your blog. Will be appended to routeBasePath . ์ ๋ URL ๋์ ์ฌ๋์๋ฅผ ๋ถ์ด์ง ๋ง์ธ์. ์์นด์ด๋ธ ์์ฑ์ ํ์ง ์์ผ๋ ค๋ฉด null ๋ก ์ค์ ํฉ๋๋ค. |
include | string[] | ['**/*.{md,mdx}'] | Array of glob patterns matching Markdown files to be built, relative to the content path. |
exclude | string[] | See example configuration | Array of glob patterns matching Markdown files to be excluded. Serves as refinement based on the include option. |
postsPerPage | !!crwdBlockTags_278_sgaTkcolBdwrc!! | 10 | ๋ชฉ๋ก ํ์ด์ง์์ ํ์ด์ง ๋น ํ์ํ ๊ฒ์๋ฌผ ์์
๋๋ค. ํ๋์ ๋ชฉ๋ก ํ์ด์ง์ ๋ชจ๋ ๊ฒ์๋ฌผ์ ํ์ํ๋ ค๋ฉด 'ALL' ์ ์ค์ ํฉ๋๋ค. |
blogListComponent | string | '@theme/BlogListPage' | ๋ธ๋ก๊ทธ ๋ชฉ๋ก ํ์ด์ง์ ๋ฃจํธ ์ปดํฌ๋ํธ์ ๋๋ค. |
blogPostComponent | string | '@theme/BlogPostPage' | ๊ฐ ๋ธ๋ก๊ทธ ๊ฒ์๋ฌผ ํ์ด์ง์ ๋ฃจํธ ์ปดํฌ๋ํธ์ ๋๋ค. |
blogTagsListComponent | string | '@theme/BlogTagsListPage' | Root component of the tags list page. |
blogTagsPostsComponent | string | '@theme/BlogTagsPostsPage' | Root component of the "posts containing tag" page. |
blogArchiveComponent | string | '@theme/BlogArchivePage' | Root component of the blog archive page. |
remarkPlugins | any[] | [] | MDX์ ์ ๋ฌ๋๋ Remark ํ๋ฌ๊ทธ์ธ์ ๋๋ค. |
rehypePlugins | any[] | [] | MDX์ ์ ๋ฌ๋๋ Rehype ํ๋ฌ๊ทธ์ธ์ ๋๋ค. |
beforeDefaultRemarkPlugins | any[] | [] | ๋ํ์ฌ์ฐ๋ฃจ์ค ๊ธฐ๋ณธ Remark ํ๋ฌ๊ทธ์ธ๋ณด๋ค ๋จผ์ MDX์ ์ ๋ฌ๋๋ ์ปค์คํ Remark ํ๋ฌ๊ทธ์ธ์ ๋๋ค. |
beforeDefaultRehypePlugins | any[] | [] | ๋ํ์ฌ์ฐ๋ฃจ์ค ๊ธฐ๋ณธ Rehype ํ๋ฌ๊ทธ์ธ๋ณด๋ค ๋จผ์ MDX์ ์ ๋ฌ๋๋ ์ปค์คํ Rehype ํ๋ฌ๊ทธ์ธ์ ๋๋ค. |
truncateMarker | RegExp | /<!--\s*(truncate)\s*-->/ | Truncate marker marking where the summary ends. |
showReadingTime | boolean | true | ๋ธ๋ก๊ทธ ๊ฒ์๋ฌผ์ ์์ ์ฝ๊ธฐ ์๊ฐ์ ํ์ํฉ๋๋ค. |
readingTime | ReadingTimeFunctionOption | ์์ ์ฝ๊ธฐ ์๊ฐ ๊ธฐ๋ณธ๊ฐ | ์์ ์ฝ๊ธฐ ์๊ฐ์ ํ์ ์๊ฐ์ ์ฌ์ฉ์ ์ง์ ํ๊ธฐ ์ํ ์ฝ๋ฐฑ์ ๋๋ค. |
authorsMapPath | string | 'authors.yml' | Path to the authors map file, relative to the blog content directory. |
feedOptions | ์์ ์ค์ ์ ์ฐธ์กฐํ์ธ์ | {type: ['rss', 'atom']} | ๋ธ๋ก๊ทธ ํผ๋์ ๋๋ค. |
feedOptions.type | !!crwdBlockTags_279_sgaTkcolBdwrc!! | ํ์ | ์์ฑํ ํผ๋ ์ ํ์
๋๋ค. ์์ฑ์ ํ์ง ์์ผ๋ ค๋ฉด null ๋ก ์ค์ ํฉ๋๋ค. |
feedOptions.title | string | siteConfig.title | ํผ๋ ์ ๋ชฉ์ ๋๋ค. |
feedOptions.description | string | !!crwdBlockTags_280_sgaTkcolBdwrc!! | ํผ๋ ์ค๋ช ์ ๋๋ค. |
feedOptions.copyright | string | undefined | ์ ์๊ถ ๊ด๋ จ ๋ฌธ๊ตฌ์ ๋๋ค. |
feedOptions.language | string (์ฌ์ฉํ ์ ์๋ ๊ฐ์ documentation๋ฅผ ์ฐธ๊ณ ํ์ธ์) | undefined | ํผ๋์ ์ธ์ด ๋ฉํ๋ฐ์ดํฐ์ ๋๋ค. |
sortPosts | !!crwdBlockTags_281_sgaTkcolBdwrc!! | 'descending' | ๋ธ๋ก๊ทธ ๊ฒ์๋ฌผ ์ ๋ ฌ ์์๋ฅผ ์ค์ ํฉ๋๋ค. |
type EditUrlFunction = (params: {
blogDirPath: string;
blogPath: string;
permalink: string;
locale: string;
}) => string | undefined;
type ReadingTimeOptions = {
wordsPerMinute: number;
wordBound: (char: string) => boolean;
};
type ReadingTimeFunction = (params: {
content: string;
frontMatter?: BlogPostFrontMatter & Record<string, unknown>;
options?: ReadingTimeOptions;
}) => number;
type ReadingTimeFunctionOption = (params: {
content: string;
frontMatter: BlogPostFrontMatter & Record<string, unknown>;
defaultReadingTime: ReadingTimeFunction;
}) => number | undefined;
type FeedType = 'rss' | 'atom' | 'json';
์ค์ ์์โ
You can configure this plugin through preset options or plugin options.
tip
Most Docusaurus users configure this plugin through the preset options.
- Preset Options
- Plugin Options
If you use a preset, configure this plugin through the preset options:
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('remark-math')],
rehypePlugins: [],
beforeDefaultRemarkPlugins: [],
beforeDefaultRehypePlugins: [],
truncateMarker: /<!--s*(truncate)s*-->/,
showReadingTime: true,
feedOptions: {
type: '',
title: '',
description: '',
copyright: '',
language: undefined,
},
},
},
],
],
};
If you are using a standalone plugin, provide options directly to the plugin:
module.exports = {
plugins: [
[
'@docusaurus/plugin-content-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('remark-math')],
rehypePlugins: [],
beforeDefaultRemarkPlugins: [],
beforeDefaultRehypePlugins: [],
truncateMarker: /<!--s*(truncate)s*-->/,
showReadingTime: true,
feedOptions: {
type: '',
title: '',
description: '',
copyright: '',
language: undefined,
},
},
],
],
};
Markdown front matterโ
Markdown documents can use the following Markdown front matter metadata fields, enclosed by a line ---
on either side.
์ค์ ํ ์ ์๋ ํ๋
ํ๋๋ช | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช |
---|---|---|---|
authors | Authors | undefined | ๋ธ๋ก๊ทธ ๊ฒ์๋ฌผ ์์ฑ์ ๋ชฉ๋ก์
๋๋ค(๋๋ ์์ฑ์). ์์ธํ ์ค๋ช
์ ์์ฑ์ ๊ฐ์ด๋๋ฅผ ์ฐธ๊ณ ํ์ธ์. Prefer authors over the author_* front matter fields, even for single author blog posts. |
author | string | undefined | โ ๏ธ authors ๋ฅผ ์ฌ์ฉํ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค. ๋ธ๋ก๊ทธ ๊ฒ์๋ฌผ ์์ฑ์ ์ด๋ฆ์
๋๋ค. |
author_url | string | undefined | โ ๏ธ authors ๋ฅผ ์ฌ์ฉํ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค. ์์ฑ์ ์ด๋ฆ์ ๋งํฌ๋ก ์ฐ๊ฒฐ๋ URL์ ์ค์ ํฉ๋๋ค. ๊นํ, ํธ์ํฐ, ํ์ด์ค๋ถ ํ๋กํ URL ๋ฑ์ ์ค์ ํ ์ ์์ต๋๋ค. |
author_image_url | string | undefined | โ ๏ธ authors ๋ฅผ ์ฌ์ฉํ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค. ์์ฑ์ ์ธ๋ค์ผ ์ด๋ฏธ์ง URL์ ์ค์ ํฉ๋๋ค. |
author_title | string | undefined | โ ๏ธ authors ๋ฅผ ์ฌ์ฉํ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค. ์์ฑ์์ ๋ํ ์ค๋ช
์
๋๋ค. |
title | string | ๋งํฌ๋ค์ด title | ๋ธ๋ก๊ทธ ๊ฒ์๋ฌผ ์ ๋ชฉ์ ๋๋ค. |
date | string | ํ์ผ๋ช ๋๋ ํ์ผ ์์ฑ ์๊ฐ | ๋ธ๋ก๊ทธ ๊ฒ์๋ฌผ ์์ฑ์ผ์
๋๋ค. ํด๋น ํ๋๋ฅผ ์ค์ ํ์ง ์์ผ๋ฉด ํ์ผ ๋๋ ํด๋๋ช
์์ ์ถ์ถํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค๋ฉด ๋ค์๊ณผ ๊ฐ์ ํ์์
๋๋ค. 2021-04-15-blog-post.mdx , 2021-04-15-blog-post/index.mdx , 2021/04/15/blog-post.mdx . ๊ทธ๋ ์ง ์์ผ๋ฉด ๋งํฌ๋ค์ด ํ์ผ์ ์์ฑํ ์๊ฐ์ผ๋ก ์ค์ ๋ฉ๋๋ค. |
tags | Tag[] | undefined | ๊ฒ์๋ฌผ์ ํ๊ทธํ๊ธฐ ์ํ ๋ฌธ์์ด ๋๋ label ๊ณผ permalink 2๊ฐ์ ํ๋๋ก ๊ตฌ์ฑ๋ ์ค๋ธ์ ํธ์ ๋ชฉ๋ก์
๋๋ค. |
draft | boolean | false | A boolean flag to indicate that the blog post is work-in-progress. Draft blog posts will only be displayed during development. |
hide_table_of_contents | boolean | false | ์ค๋ฅธ์ชฝ์ ํ์๋๋ ๋ชฉ์ฐจ ์จ๊น ์ฌ๋ถ๋ฅผ ์ค์ ํฉ๋๋ค. |
toc_min_heading_level | number | 2 | ๋ชฉ์ฐจ์ ํ์๋ ์ ๋ชฉ ์์ค ์ต์๊ฐ์ ์ค์ ํฉ๋๋ค. 2์์ 6 ์ฌ์ด์ ๊ฐ์ผ๋ก ์ค์ ํ ์ ์๊ณ ์ต๋๊ฐ๋ณด๋ค ์๊ฑฐ๋ ๊ฐ์์ผ ํฉ๋๋ค. |
toc_max_heading_level | number | 3 | ๋ชฉ์ฐจ์ ํ์๋ ์ ๋ชฉ ์์ค ์ต๋๊ฐ์ ์ค์ ํฉ๋๋ค. 2์์ 6 ์ฌ์ด์ ๊ฐ์ผ๋ก ์ค์ ํ ์ ์์ต๋๋ค. |
keywords | string[] | undefined | ํค์๋ ๋ฉํ ํ๊ทธ์
๋๋ค. <meta name="keywords" content="keyword1,keyword2,..."/> ํ๊ทธ๊ฐ ์์ ์์ฑ๋ฉ๋๋ค.<head> , ๊ฒ์ ์์ง์์ ์ฌ์ฉํฉ๋๋ค. |
description | string | The first line of Markdown content | The description of your document, which will become the <meta name="description" content="..."/> and <meta property="og:description" content="..."/> ํ๊ทธ๊ฐ ์์ ์์ฑ๋ฉ๋๋ค.<head> , used by search engines. |
image | string | undefined | ๊ฒ์๊ธ์ ๋ํ ๋งํฌ๋ฅผ ํ์ํ ๋ ๋ณด์ฌ์ง๋ ์ปค๋ฒ ๋๋ ์ฌ๋ค์ผ ์ด๋ฏธ์ง๋ฅผ ์ค์ ํฉ๋๋ค. |
slug | string | File path | Allows to customize the blog post url (/<routeBasePath>/<slug> ). ์ฌ๋ฌ ํจํด์ ์ค์ ํ ์๋ ์์ต๋๋ค: slug: my-blog-post , slug: /my/path/to/blog/post , slug: / . |
type Tag = string | {label: string; permalink: string};
// An author key references an author from the global plugin authors.yml file
type AuthorKey = string;
type Author = {
key?: AuthorKey;
name: string;
title?: string;
url?: string;
image_url?: string;
};
// The front matter authors field allows various possible shapes
type Authors = AuthorKey | Author | (AuthorKey | Author)[];
์:
---
title: Welcome Docusaurus v2
authors:
- slorber
- yangshun
- name: Joel Marcey
title: Co-creator of Docusaurus 1
url: https://github.com/JoelMarcey
image_url: https://github.com/JoelMarcey.png
tags: [hello, docusaurus-v2]
description: This is my first post on Docusaurus 2.
image: https://i.imgur.com/mErPwqL.png
hide_table_of_contents: false
---
A Markdown blog post
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
โ
โ # translations for website/blog
โโโ authors.yml
โโโ first-blog-post.md
โโโ second-blog-post.md
โ
โ # translations for the plugin options that will be rendered
โโโ options.json