Publish documents and blog with Docusaurus
Tutorial Docusaurus in 5 min
from Docusaurus
Introduction docs of Docuraurus
can be found at link
Playground to test Docusaurus in browser, without installing anything. Read more at link
It is easy to translate a Docusaurus site with its internationalization (i18n) support. Read more at link
Thoughts
My thoughts on Version: 2.0.0-beta.13
Pros:
- generate documents as a Single Page Application (SPA), dark mode
- Has sidebar navigation, menu bar, search bar, admonition, i18n built-in (crowdin plugin or alternative locale markdown files),
Next
andPrevious
UI links at the end of each doc page, tabbed content. - has url slug in frontmatter to generate a static URL for each md file
Cons:
- when I reorganize the hierarchy structure of md files (ie. move to other folder, rename folder that contains md files, rename md files) in
docs
folder, I need to manually- update doc IDs in my sidebar file, since notes hierarchy structure are hardcoded in sidebar file for sidebar for navigation
- update the reference links to other markdown files
- does not support wikilink style, need custom script to convert to markdown link. Or use a plugin in Obsidian to convert the link in notes within your vault.
Related resources
- Tutorial in details by Zatta Production
- Tutorial in details by Danny Chávez
- Tutorial in details by LogRocket
- Basic tutorial by Victoria Lo
- Reason to use Docusaurus by JavaScript in Plain English
- Deployment guide from Docusarus.
- Integrate PostHog analytics (free alternative of Plausible) to Docusaurus v2 site by Evan Tay
- Fathom analytics plugin for Docusaurus v2
Getting started
What I did step-by-step on my Windows 10 machine.
- Open terminal, go to the local folder of my workspace
cd .\my_workspace\
- create a new Docusaurus site named
datadiva-docusaurus
with themeclassic
Result: a new foldernpx create-docusaurus@latest datadiva-docusaurus classic
datadiva-docusaurus
will be created insidemy_workspace
- Login to my GitHub profile, create a new repo called
datadiva-docusaurus
- Open terminal, go to folder
datadiva-docusaurus
cd .\my_workspace\datadiva-docusaurus
- Initialize git
git init
- Add all files in current working folder and all other directories recursively that are not specified in the
.gitignore
to gitgit add .
- Commit the change
git commit -m "first commit"
- Create the branch
main
git branch -M main
- Connect my GitHub repo with my computer
git remote add origin git@github.com:h7b/datadiva-docusaurus.git
- Push changes from my local working folder to my remote repo
git push -u origin main
Deploy my Docusaurus static site on Render
Render free plans introduction and limitations
The offical deployment guide from Render is for Docusaurus v1
. It's not applicable for site created with Docusaurus v2
like mine.
Step-by-step to deploy my datadiva-docusaurus
static site on Render:
- Create a new Static Site on Render, and give Render permission to access your Docusaurus repo
- I use the following values during creation
- Name:
datadiva
- Build Command:
yarn build
- Publish Directory:
build
- Name:
Backlinks