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 and Previous 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.

Getting started

What I did step-by-step on my Windows 10 machine.

  1. Open terminal, go to the local folder of my workspace
    cd .\my_workspace\
    
  2. create a new Docusaurus site named datadiva-docusaurus with theme classic
    npx create-docusaurus@latest datadiva-docusaurus classic
    
    Result: a new folder datadiva-docusaurus will be created inside my_workspace
  3. Login to my GitHub profile, create a new repo called datadiva-docusaurus
  4. Open terminal, go to folder datadiva-docusaurus
    cd .\my_workspace\datadiva-docusaurus
    
  5. Initialize git
    git init
    
  6. Add all files in current working folder and all other directories recursively that are not specified in the .gitignore to git
    git add .
    
  7. Commit the change
    git commit -m "first commit"
    
  8. Create the branch main
    git branch -M main
    
  9. Connect my GitHub repo with my computer
    git remote add origin git@github.com:h7b/datadiva-docusaurus.git
    
  10. 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:

  1. Create a new Static Site on Render, and give Render permission to access your Docusaurus repo
  2. I use the following values during creation
    • Name: datadiva
    • Build Command: yarn build
    • Publish Directory: build

Backlinks