What is @docusaurus/preset-classic?
@docusaurus/preset-classic is a preset for Docusaurus, a static site generator. It provides a set of plugins and themes that help you quickly set up a documentation website with features like a blog, custom pages, and more.
What are @docusaurus/preset-classic's main functionalities?
Documentation
This feature allows you to set up a documentation site with a sidebar for navigation. The code sample shows how to configure the documentation plugin within the preset.
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
},
},
],
],
};
Blog
This feature enables a blog section on your site. The code sample demonstrates how to configure the blog plugin to show reading time for each post.
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
blog: {
showReadingTime: true,
},
},
],
],
};
Custom Pages
This feature allows you to create custom pages for your site. The code sample shows how to configure the pages plugin to use a specific directory for custom pages.
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
pages: {
path: 'src/pages',
},
},
],
],
};
Theme
This feature lets you customize the theme of your site. The code sample demonstrates how to include a custom CSS file for additional styling.
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
],
],
};
Other packages similar to @docusaurus/preset-classic
gatsby
Gatsby is a React-based open-source framework for creating websites and apps. It offers a rich plugin ecosystem and is highly customizable, making it a strong alternative to Docusaurus for building static sites.
vuepress
VuePress is a Vue-powered static site generator. It is designed for creating documentation and offers a simple, minimalistic approach. It is a good alternative for those who prefer Vue over React.
mkdocs
MkDocs is a static site generator that's geared towards project documentation. It uses Markdown for content and offers a variety of themes. It is simpler and more lightweight compared to Docusaurus.