- Clone this repo:
git clone git@github.com:pantheon-systems/gatsby-wordpress-starter.git
- Install node modules
cd decoupled-wp-gatsby-frontend-demo && npm install
- Save
.env.example
as.env.local
add/update following lines:
WPGRAPHQL_URL=
-
Run
npm run develop
-
Open a browser and navigate to
http://localhost:8000
.
This project can also be run using Lando. This will be especially helpful if you are also using Lando for local WordPress development and would like to use Gatsby preview since Docker can't easily communicate with localhost.
To use Lando run:
lando start
This will make a NodeJS server available at http://wp-gatsby-frontend.lndo.site/
. Your preview webhook will be http://wp-gatsby-frontend.lndo.site/__refresh
Other commands:
lando node
- runs the Gatsby development server (which should also run onlando start
).lando gatsby <command>
- run Gatsby cli commands.
For a guide on creating your first Gatsby WordPress customization, see Your First WordPress Customization