Skip to content
A starter for WordPress + Gatsby that supports live previews
JavaScript PHP CSS
Branch: master
Clone or download
Latest commit 7239134 Aug 29, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
site refactor and directory change Aug 13, 2019
theme refactor and directory change Aug 13, 2019
.gitignore first commit Aug 6, 2019
.gitmodules update modules Aug 29, 2019
README.md update readme Aug 29, 2019
package.json refactor and directory change Aug 13, 2019
yarn.lock remove unused packages Aug 12, 2019

README.md

Gatsby

WordPress + Gatsby + Preview Starter

The repository contains a WordPress Docker container plus a Gatsby theme that supports live previews and a starter site.

🚀 Quick start

  1. RECURSIVELY Clone this repo. git clone --recursive ...

  2. Rename theme/sample.env > .env & enter creds. Hint: current creds will work.

  3. In the root of the repo run yarn

  4. From the theme directory, run docker-compose up

  5. Run through WordPress install @ http://localhost:3030

  6. Activate WPGraphQL plugin

  7. Activate WP Headless theme

  8. Enable Permalinks

  9. Fire up the Gatsby Starter Site: In the root of the project run yarn workspace site develop

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

  1. Both the WordPress Docker container need to run on the same domain. Locally this is, of course, localhost:anyport. In production, this could also be https://mydomain.com + https://data.mydomain.com.

  2. Gutenberg is disabled. There are some outstanding bugs in regards to filtering preview_post_link noted here.

  3. Gatsby must run on port :8000. Access-Control-Allow-Origin header is hard-coded in to 8000 in headers.php

You can’t perform that action at this time.