Commit b3d02d97 authored by Benji Fisher's avatar Benji Fisher

Merge branch '25-use-a-different-directory-for-gatsby-develop-and-build-sites' into 'master'

Resolve "Use a different directory for Gatsby develop and build sites"

Closes #25

See merge request !16
parents 6278c58e 544df74d
......@@ -42,6 +42,7 @@ events:
post-start:
- nodejs: echo "Building the Gatsby site from Drupal."
- nodejs: cd gatsby && gatsby build
- nodejs: rm -rf gatsbydrupal/* && cp -R gatsby/public/* gatsbydrupal
tooling:
npm:
......
......@@ -37,7 +37,8 @@ you will need one of
- Windows 10 Pro+ (or equivalent) with Hyper-V running
- Linux (with kernel version 4.x or higher)
So far, I have tested only with macOS 10.13 (High Sierra) and 10.14 (Mojave).
So far, I have tested only with macOS 10.13 (High Sierra), 10.14 (Mojave),
and Ubuntu 18.10 (cosmic).
#### Installation
......@@ -76,10 +77,9 @@ It will
- Install the Gatsby CLI tool.
- Install `yarn` (with `npm`).
- Install Drupal with the Umami demo profile.
- Install the [JSON:API](https://www.drupal.org/project/jsonapi) Drupal
module.
- Install a Gatsby project pulling data from the Drupal site.
- Build the Gatsby project.
- Move the Gatsby site to `gatsbydrupal/`.
- Tell you which URLs are being served.
In particular, you should be able to visit these pages in a web browser.
......@@ -121,12 +121,15 @@ subdirectory of the project.
Either way, you should be able to view your site at any of these URLS:
- https://gatsby.lgd.lndo.site/ (security warning from browser)
- http://gatsby.lgd.lndo.site/
- http://gatsby.lgd.lndo.site/blog/ (a list of articles imported from Drupal)
- [http://gatsby.lgd.lndo.site/\_\_\_graphql](http://gatsby.lgd.lndo.site/___graphql)
- https://gatsby.lgd.lndo.site/
- https://gatsby.lgd.lndo.site/blog/ (a list of articles imported from Drupal)
- [https://gatsby.lgd.lndo.site/\_\_\_graphql](https://gatsby.lgd.lndo.site/___graphql)
(The GraphiQL browser)
These HTTPS pages will all trigger a security warning from your browser.
On macOS, but not Linux, you can avoid the warning by using HTTP variants.
I have not tested on Windows.
The GraphiQL browser is available only when running the Gatsby development
server.
......@@ -135,6 +138,12 @@ Use CTRL-C in your terminal window to stop the node server.
For sample command-line output, see
[Starting Gatsby](docs/gatsby-log.md).
#### Note
If you want to view the updated site at https://gatsbydrupal.lgd.lndo.site
after `lando gatsby build`, then copy the bulit site from `gatsby/public/` to
`gatsbydrupal/`. This is done automatically when you (re)start Lando.
### Create a Gatsby project
If you want to run additional Gatsby sites, then run the following commands
......
......@@ -13,7 +13,7 @@ server {
ssl_prefer_server_ciphers on;
location / {
root "/app/gatsby/public";
root "/app/gatsbydrupal";
index index.html index.htm;
}
......@@ -23,6 +23,6 @@ server {
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root "/app/gatsby/public";
root "/app/gatsbydrupal";
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment