A training workshop by Mediacurrent.
This repo will allow you to get the codebase to build a new Gatsby website which has been configured to pull its content from Drupal. Both Gatsby and Drupal run locally.
- macOS 10.13 or later
- Windows 10 Pro+ or equivalent (eg Windows 10 Enterprise) with Hyper-V running
- Linux with kernel version 4.x or higher
- Docker - macOS or Windows 10
- Lando - macOs or Windows 10
- NVM
- NodeJS & NPM
Instructions for installing NVM, Node & NPM on macOS or Windows.
You can clone or download the repo anywhere in your computer (i.e. Sites, Downloads, Documents, Desktop, etc.)
git clone https://github.com/mariohernandez/gatsby_training.git
After cloning the repo, cd into the newly created directory:
cd gatsby_training
lando start
This will build your Docker containers needed to run Gatsby and Drupal. NOTE: Docker needs to be running before running lando start
.
cd gatsby
nvm use
If you get errors, you can try running: nvm install
then nvm use
. This will use the version of node specified inside .nvmrc
npm install
The above command looks in package.json
and will install all the dependencies listed there.
Before you can run gatsby commands, you need to install the Gatsby CLI globally.
npm install -g gatsby-cli
gatsby develop
This will start Gatsby which should immediately connect to Drupal to pull all content.
http://localhost:8000/___graphql
https://nitflex.lndo.site/user/login
Your credentials are: username: admin
, password: admin
Depending on your unique environment, the Drupal URL generated by Lando may be slightly different than the one listed in these instructions. If that is the case, update Gatsby's configuration to reflect your actual URL.
- In your editor, open
gatsby/gatsby-config.js
- Change the
baseUrl
entry at the bottom of the file to use the Drupal URL shown when you ranlando start