This is based off of the Gatsby Drupal blog example, with some modifications to allow bloggers to write articles in commonmark markdown format.
After starting Drupal, create a new text format for your markdown blog inputs.
This should be a plaintext input format. Do not use the Markdown
filter, as this
converts markdown input into HTML.
The raw markdown source should be retrieved by the Gatsby dev server and parsed
by the unified.js
parsing layer into React components.
I use the ContentaCMS headless Drupal distributing based off of Drupal Core 8. These instructions probably translate to standard Drupal 8, as 8 switches the Core API to be headless by default.