What is @docusaurus/plugin-content-blog?
@docusaurus/plugin-content-blog is a plugin for Docusaurus, a static site generator. This plugin allows you to create and manage a blog within your Docusaurus site. It provides features like blog post creation, pagination, tags, and more.
What are @docusaurus/plugin-content-blog's main functionalities?
Create Blog Posts
This feature allows you to create and manage blog posts in Markdown or MDX format. The configuration specifies the path to the blog directory, the route base path, and other settings like the blog title and description.
module.exports = {
plugins: [
[
'@docusaurus/plugin-content-blog',
{
path: './blog',
routeBasePath: '/blog',
include: ['*.md', '*.mdx'],
blogTitle: 'My Blog',
blogDescription: 'A Docusaurus powered blog!',
},
],
],
};
Pagination
This feature enables pagination for your blog posts. You can specify the number of posts per page using the `postsPerPage` option.
module.exports = {
plugins: [
[
'@docusaurus/plugin-content-blog',
{
path: './blog',
routeBasePath: '/blog',
postsPerPage: 10,
},
],
],
};
Tags
This feature allows you to categorize your blog posts using tags. The configuration can also include options to show reading time and customize the blog sidebar.
module.exports = {
plugins: [
[
'@docusaurus/plugin-content-blog',
{
path: './blog',
routeBasePath: '/blog',
showReadingTime: true,
blogSidebarCount: 'ALL',
blogSidebarTitle: 'All posts',
},
],
],
};
Other packages similar to @docusaurus/plugin-content-blog
hexo
Hexo is a fast, simple, and powerful blog framework. It provides a wide range of features for creating and managing blogs, including support for Markdown, extensive theming options, and plugins for additional functionalities. Unlike @docusaurus/plugin-content-blog, Hexo is a standalone framework rather than a plugin for a static site generator.
jekyll
Jekyll is a static site generator focused on blogging. It offers features like Markdown support, templates, and plugins. Jekyll is highly customizable and is often used for GitHub Pages. While it provides similar blogging functionalities, it is a standalone tool rather than a plugin for another static site generator like @docusaurus/plugin-content-blog.
2.0.0-alpha.19 (2019-06-07)
- Add a sensible default for browserslist config.
- UI
- Add sun and moon emoji to the dark mode toggle.
- Mobile responsive menu.
- Right table of contents for docs is now sticky.
- Plugins
- Change plugin definitions from classes to functions. Refer to the new plugin docs.
- Implement Clients module API.
- Change format within
docusaurus.config.js
to be like presets.
- Deps
- Infima CSS is now locked down to specific versions and not relying upon the CDN which reads from trunk.
- Update dependencies to latest
- Customize/ Override infima CSS variables by passing options into the classic preset.
presets: [
[
'@docusaurus/preset-classic',
{
theme: {
customCss: require.resolve('./css/custom.css'),
},
...
},
],
],
- Allow passing remark and rehype plugins to mdx-loader for docs and blog plugin
- Move themes component of docs and blog to be part of theme-classic
- Use composition style for prism syntax highlighting instead of doing it via rehype plugin
- Pass MDXProvider to docs and blog. To change the provided MDX components, run
docusaurus swizzle @docusaurus/theme-classic MDXComponents
- Add @docusaurus/theme-livecodeblock plugin
- Better run-time code generation & webpack splitchunks optimization
- Minify css for production build
- Fix weird scrolling problem when navigating to a route with a
hash
location
V2 Changelog (2019-04-10)