Check out bidbear.io Amazon Advertising for Humans. Now publicly available πŸš€

Docusaurus v2 Notes

Intro

Some notes on Docusaurus v2.

Blog

Post Date and File Structure

In Docusaurus post dates are not extracted from YAML frontmatter, but instead are taken from the .md filename.

.
β”œβ”€β”€ 2019-05-28-first-blog-post.md
β”œβ”€β”€ 2019-05-29-long-blog-post.md
β”œβ”€β”€ 2021-08-01-mdx-blog-post.mdx
β”œβ”€β”€ 2021-08-26-welcome
β”‚   β”œβ”€β”€ docusaurus-plushie-banner.jpeg
β”‚   └── index.md
└── authors.yml

Also note that markdown files can be grouped in folders with images or not.

Authors

Author info is extracted from the yml file shown above which takes this format

nick:
  name: Nicholas Coughlin
  title: Founder @ bidbear.io
  url: https://ncoughlin.com
  image_url: https://github.com/ncoughlin.png

and is then referenced in the yml frontmatter for a post.

blog-post-frontmatter
---
slug: welcome
title: Welcome
authors: [nick]
tags: [facebook, hello, docusaurus]
---

Docs

The docs are generated from the docs folder and items there take this file structure

.
β”œβ”€β”€ intro.md
β”œβ”€β”€ tutorial-basics
β”‚   β”œβ”€β”€ _category_.json
β”‚   β”œβ”€β”€ congratulations.md
β”‚   β”œβ”€β”€ create-a-blog-post.md
β”‚   β”œβ”€β”€ create-a-document.md
β”‚   β”œβ”€β”€ create-a-page.md
β”‚   β”œβ”€β”€ deploy-your-site.md
β”‚   └── markdown-features.mdx
└── tutorial-extras
    β”œβ”€β”€ _category_.json
    β”œβ”€β”€ img
    β”‚   β”œβ”€β”€ docsVersionDropdown.png
    β”‚   └── localeDropdown.png
    β”œβ”€β”€ manage-docs-versions.md
    └── translate-your-site.md

And from this it’s not clear how these items are ordered in the sidebar. That is done with frontmatter in the files

intro.md
---
sidebar_position: 1
---

and that position is relative to it’s location, so if it’s a markdown file in one of the folders, it would be the position of the item in that folder.

Amazon Ad Analytics For Humans

Advertising reports automatically saved and displayed beautifully for powerful insights.

bidbear.io
portfolios page sunburst chart