Configuration
Documents are groups of pages connected through:
- a sidebar
- previous/next navigation
- versioning
Create your first Docβ
Create a markdown file at docs/hello.md
:
# Hello
This is my **first Docusaurus document**!
A new document is now available at http://localhost:3000/docs/hello
.
Configure the Sidebarβ
Docusaurus automatically creates a sidebar from the docs
folder.
Add metadata to customize the sidebar label and position:
---
sidebar_label: 'Hi!'
sidebar_position: 3
---
# Hello
This is my **first Docusaurus document**!
It is also possible to create your sidebar explicitly in sidebars.js
:
module.exports = {
tutorialSidebar: [
{
type: 'category',
label: 'Tutorial',
- items: [...],
+ items: ['hello'],
},
],
};
Examples
Docusaurus creates a page for each blog post, but also a blog index page, a tag system, an RSS feed...
Create your first Postβ
Create a file at blog/2021-02-28-greetings.md
:
---
slug: greetings
title: Greetings!
authors:
- name: Joel Marcey
title: Co-creator of Docusaurus 1
url: https://github.com/JoelMarcey
image_url: https://github.com/JoelMarcey.png
- name: SΓ©bastien Lorber
title: Docusaurus maintainer
url: https://sebastienlorber.com
image_url: https://github.com/slorber.png
tags: [greetings]
---
Congratulations, you have made your first post!
Feel free to play around and edit this post as much you like.
A new blog post is now available at http://localhost:3000/blog/greetings
.
Deploy your site
Docusaurus is a static-site-generator (also called Jamstack).
It builds your site as simple static HTML, JavaScript and CSS files.
Build your siteβ
Build your site for production:
npm run build
The static files are generated in the build
folder.
Deploy your siteβ
Test your production build locally:
npm run serve
The build
folder is now served at http://localhost:3000/
.
You can now deploy the build
folder almost anywhere easily, for free or very small cost (read the Deployment Guide).
Installation!
You have just learned the basics of Docusaurus and made some changes to the initial template.
Docusaurus has much more to offer!
Have 5 more minutes? Take a look at versioning and i18n.
Anything unclear or buggy in this tutorial? Please report it!
What's next?β
- Read the official documentation.
- Add a custom Design and Layout
- Add a search bar
- Find inspirations in the Docusaurus showcase
- Get involved in the Docusaurus Community