Awesome
<p align="center"> <a href="https://www.gatsbyjs.org"> <img alt="Gatsby" src="https://www.gatsbyjs.org/monogram.svg" width="60" /> </a> </p> <h1 align="center"> WordPress + Gatsby + Preview Starter </h1>The repository contains a WordPress Docker container plus a Gatsby theme that supports live previews and a starter site.
🚀 Quick start
-
RECURSIVELY Clone this repo.
git clone --recursive ...
-
Rename
theme/sample.env
>.env
& enter creds. Hint: current creds will work. -
In the root of the repo run
yarn
-
From the
theme
directory, rundocker-compose up
-
Run through WordPress install @ http://localhost:3030
-
Activate WPGraphQL plugin
-
Activate WP Headless theme
-
Enable Permalinks
-
Fire up the Gatsby Starter Site: In the root of the project run
yarn workspace site develop
-
Navigate to the "Hello World" post, change something & click the preview button
Custom Post Type Previews?
Yes! The included WordPress theme registers a beer custom post type. Simply add a beer post and click the preview button.
Known limitations:
-
Both the WordPress Docker container need to run on the same domain. Locally this is, of course,
localhost:anyport
. In production, this could also behttps://mydomain.com
+https://data.mydomain.com
. -
Gutenberg is disabled. There are some outstanding bugs in regards to filtering
preview_post_link
noted here. -
Gatsby must run on port
:8000
.Access-Control-Allow-Origin
header is hard-coded in to8000
inheaders.php