Skip to content

jasonbahl/wordpress-gatsby-preview-starter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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. Clone this repo.

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

  3. In the root of the repo run yarn

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

About

A starter for WordPress + Gatsby that supports live previews

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 69.2%
  • PHP 30.0%
  • CSS 0.8%