๐ฆ plugin-content-blog
๋ธ๋ก๊ทธ ๋ง๋ค๊ธฐ ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ ๋ํ์ฌ์ฐ๋ฃจ์ค์ ๊ธฐ๋ณธ ๋ธ๋ก๊ทธ ํ๋ฌ๊ทธ์ธ์ ๋๋ค.
#
์ค์น- npm
- Yarn
npm install --save @docusaurus/plugin-content-blog
yarn add @docusaurus/plugin-content-blog
tip
@docusaurus/preset-classic
์ ์ค์นํ ๊ฒฝ์ฐ์๋ ํ
๋ง๋ฅผ ๋ฐ๋ก ์ค์นํ ํ์๋ ์์ต๋๋ค. ์๋์ ๊ฐ์ด ์ค์ ํ๋ ๋์ classic preset options์์ ์ค์ ํ ์ ์์ต๋๋ค.
#
์ค์ docusaurus.config.js
module.exports = { plugins: [ [ '@docusaurus/plugin-content-blog', { /** * ์ฌ์ดํธ ๋๋ ํฐ๋ฆฌ์ ์๋ ๊ฒฝ๋ก๋ก ํ์ผ ์์คํ
์ ๋ฐ์ดํฐ ๊ฒฝ๋ก๋ฅผ ์ค์ ํฉ๋๋ค. */ path: 'blog', /** * ์ฌ๋ฌ๋ถ์ ์ฌ์ดํธ๋ฅผ ํธ์งํ๊ธฐ ์ํ Base url์ ์ค์ ํฉ๋๋ค. * ๋ํ์ฌ์ฐ๋ฃจ์ค๋ "editUrl + relativeDocPath" ํ์์ผ๋ก ์ค์ ํธ์งํ ์ ์๋ editUrl์ ์ฒ๋ฆฌํฉ๋๋ค. */ editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/', /** * ํ์์ ๋ฐ๋ผ ๊ฐ ๋งํฌ๋ค์ด ํ์ผ์ editUrl์ ์ง์ ์ค์ ํด์ค ์ ์์ต๋๋ค. */ editUrl: ({locale, blogDirPath, blogPath, permalink}) => { return `https://github.com/facebook/docusaurus/edit/master/website/${blogDirPath}/${blogPath}`; }, /** * ๋ฒ์ญํ ํ์ผ์ ๊น์ ์ปค๋ฐํ๋ ๊ฒฝ์ฐ ์ ์ฉํ ์ค์ ์
๋๋ค. * ๋งํฌ๋ค์ด ํ์ผ์ ํ์งํํ๊ฒ ๋๋ฉด ํธ์ง URL์ ํ์งํ๋์ง ์์ ์๋ณธ ํ์ผ ๋์ * ํ์งํ๋ ํ์ผ์ ๊ฐ๋ฆฌํค๊ฒ ๋ฉ๋๋ค. * ์ฐธ๊ณ : editUrl์ด ํจ์์ธ ๊ฒฝ์ฐ์๋ ํด๋น ์ต์
์ ๋ฌด์ํฉ๋๋ค. */ editLocalizedFiles: false, /** * ์ฌ์ดํธ ๊ฒ์ ์ต์ ํ๋ฅผ ์ํ ๋ธ๋ก๊ทธ ์ ๋ชฉ์ ์ค์ ํฉ๋๋ค. */ blogTitle: 'Blog title', /** * ์ฌ์ดํธ ๊ฒ์ ์ต์ ํ๋ฅผ ์ํ ๋ธ๋ก๊ทธ ํ์ด์ง ๋ฉํ ์ค๋ช
์ ์ค์ ํฉ๋๋ค. */ blogDescription: 'Blog', /** * ๋ธ๋ก๊ทธ ์ฌ์ด๋๋ฐ์์ ํ์ํ ๋ธ๋ก๊ทธ ํฌ์คํธ ๊ฐ์๋ฅผ ์ค์ ํฉ๋๋ค. * 'ALL'๋ก ์ค์ ํ๋ฉด ๋ชจ๋ ๋ธ๋ก๊ทธ ํฌ์คํธ๋ฅผ ํ์ํฉ๋๋ค. * 0์ผ๋ก ์ค์ ํ๋ฉด ํฌ์คํธ๋ฅผ ํ์ํ์ง ์์ต๋๋ค. */ blogSidebarCount: 5, /** * ๋ธ๋ก๊ทธ ์ฌ์ด๋๋ฐ ์ ๋ชฉ์ ์ค์ ํฉ๋๋ค. */ blogSidebarTitle: 'All our posts', /** * ์ฌ๋ฌ๋ถ์ ์ฌ์ดํธ ๋ธ๋ก๊ทธ URL ๊ฒฝ๋ก๋ฅผ ์ค์ ํฉ๋๋ค. * *์ ๋* URL ๋์ ์ฌ๋์๋ฅผ ๋ถ์ด์ง ๋ง์ธ์. */ routeBasePath: 'blog', include: ['*.md', '*.mdx'], postsPerPage: 10, /** * ๋ธ๋ก๊ทธ ํ์ด์ง์ ์ฌ์ฉํ ํ
๋ง ์ปดํฌ๋ํธ๋ฅผ ์ค์ ํฉ๋๋ค. */ blogListComponent: '@theme/BlogListPage', blogPostComponent: '@theme/BlogPostPage', blogTagsListComponent: '@theme/BlogTagsListPage', blogTagsPostsComponent: '@theme/BlogTagsPostsPage', /** * MDX์ ์ ๋ฌํ Remark, Rehype ํ๋ฌ๊ทธ์ธ์ ์ค์ ํฉ๋๋ค. */ remarkPlugins: [ /* require('remark-math') */ ], rehypePlugins: [], /** * ๊ธฐ๋ณธ Remark, Rehype ํ๋ฌ๊ทธ์ธ์ด ์ ์ฉ๋๊ธฐ ์ ์ * MDX์ ์ฌ์ฉ์ ์ง์ Remark, Rehype ํ๋ฌ๊ทธ์ธ์ ์ ๋ฌํ๋๋ก ์ค์ ํฉ๋๋ค. */ beforeDefaultRemarkPlugins: [], beforeDefaultRehypePlugins: [], /** * ์ ๊ท์ ๋๋ ๋ฌธ์์ด์ ์ฌ์ฉํด ์๋ฅด๊ธฐ๋ฅผ ์ค์ ํฉ๋๋ค. */ truncateMarker: /<!--\s*(truncate)\s*-->/, /** * ๋ธ๋ก๊ทธ ๊ฒ์๋ฌผ์ ์์ ์ฝ๊ธฐ ์๊ฐ์ ํ์ํฉ๋๋ค. */ showReadingTime: true, /** * ๋ธ๋ก๊ทธ ํผ๋๋ฅผ ์ค์ ํฉ๋๋ค. * feedOptions์ ์ค์ ํ์ง ์์ผ๋ฉด RSS ํผ๋๊ฐ ๋ง๋ค์ด์ง์ง ์์ต๋๋ค. */ feedOptions: { type: '', // ํ์๊ฐ. 'rss' | 'feed' | 'all' title: '', // ๊ธฐ๋ณธ๊ฐ์ siteConfig.title ์
๋๋ค. description: '', // ๊ธฐ๋ณธ๊ฐ์ `${siteConfig.title} Blog`์
๋๋ค. copyright: '', language: undefined, // ๋ค์๊ณผ ๊ฐ์ ๊ฐ์ ์ค์ ํ ์ ์์ต๋๋ค: http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes }, }, ], ],};
#
i18ni18n ์๊ฐ ๋ฌธ์๋ฅผ ๋จผ์ ํ์ธํด์ฃผ์ธ์.
#
๋ฒ์ญ ํ์ผ ์์น- ๊ธฐ๋ณธ ๊ฒฝ๋ก:
website/i18n/<locale>/docusaurus-plugin-content-blog
- ๋ฉํฐ ์ธ์คํด์ค ๊ฒฝ๋ก:
website/i18n/<locale>/docusaurus-plugin-content-blog-<pluginId>
- JSON ํ์ผ: ํด๋น์์
- ๋งํฌ๋ค์ด ํ์ผ:
website/i18n/<locale>/docusaurus-plugin-content-blog
#
ํ์ผ ์์คํ ๊ตฌ์กฐ ์website/i18n/<locale>/docusaurus-plugin-content-blogโโ # translations for website/blogโโโ first-blog-post.mdโโโ second-blog-post.md