-
Install Docker
-
Start developing.
Just startup all your environment with one of this commands
docker-compose -f docker-compose.yaml -f docker-compose.dev.yaml up
ornpm run docker:dev
Initially it will create image: download and setup layers for NodeJS, Wordpress, MySQL and Gatsby, and startup containers. Further runnings will only startup containers.
-
To shut down environment just type
docker-compose down
ornpm run docker:down
Setup your local Wordpress :
- Make an initial installation
- Enable Wordpress plugins ( ACF to REST API, Advanced Custom Fields, Custom Post Type UI, WP REST API Menus )
- Setup
pretty permalinks
Settings => Permalinks => choose 'Post name' and save.
Restart Gatsby container manually or stop/start everything to make Gatsby properly initialized
- Go to the GrapihQL editor and try out queries:
{
allWordpressPost {
edges {
node {
id
slug
title
content
excerpt
date
modified
}
}
}
}
- Try out Gatsby Site
After wordpress setup in wordpress/engine
folder will be content that bind directly to wordpress container. You can easily modify it locally.
!!! Note that wordpress/plugins_for_setup
used to copy initial plugins for setup. Don't use this folder after wordpress initialization.
Looking for more guidance? Full documentation for Gatsby lives on the website. Here are some places to start:
-
For most developers, we recommend starting with our in-depth tutorial for creating a site with Gatsby. It starts with zero assumptions about your level of ability and walks through every step of the process.
-
To dive straight into code samples, head Gatsby documentation. In particular, check out the Guides, API Reference, and Advanced Tutorials sections in the sidebar.