The repository contains a WordPress Docker container plus a Gatsby theme that supports live previews and a starter site. hope it works for you !
-
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
Yes! The included WordPress theme registers a beer custom post type. Simply add a beer post and click the preview button.
-
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://[YOUR DOMAIN]
+https://data.[YOUR DOMAIN]
. -
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