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