๋ฉ”์ธ ์ปจํ…์ธ ๋กœ ์ด๋™
Version: 2.0.0-beta.0

๐Ÿ“ฆ plugin-content-blog

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

์„ค์น˜#

npm install --save @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        },      },    ],  ],};

i18n#

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

๋ฒˆ์—ญ ํŒŒ์ผ ์œ„์น˜#

  • ๊ธฐ๋ณธ ๊ฒฝ๋กœ: 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