Skip to content

Repository files navigation

lib.umich.edu

lib.umich.edu is a headless Drupal site, built with Gatsby and React as the front-end.

🚀 Quick start

  1. Clone lib.umich.edu.
gh repo clone mlibrary/lib.umich.edu
  1. Install dependencies.

Navigate into your site’s directory and install dependencies with NPM.

cd lib.umich.edu/
npm install
  1. Configuration
ROBOTSTXT_MODE=production

If ROBOTSTXT_MODE is set to production, this tells the build to generate a robots.txt that allows search engines to crawl the site. If this variable is not set (or set to anything other than production), the build produces a robots.txt that blocks all crawlers.

DRUPAL_URL=https://cms.staging.lib.umich.edu/

The site by default will build and pull data from https://cms.lib.umich.edu/, but you can change that with setting DRUPAL_URL.

DRUPAL_CONCURRENT_FILE_REQUESTS

You can optionally set DRUPAL_CONCURRENT_FILE_REQUESTS to adjust the gatsby-source-drupal concurrentFileRequests option (defaults to 20) to change how many simultaneous file requests are made to the server/service. This benefits build speed, however too many concurrent file request could cause memory exhaustion depending on the machines memory size so change with caution.

For example, run:

DRUPAL_CONCURRENT_FILE_REQUESTS=60 npm start

or

DRUPAL_CONCURRENT_FILE_REQUESTS=5 npm start

And see what works best for your network connection, memory, and general situation.

  1. Start developing.

Start it up.

npm start

If you wish to pull data from the staging CMS rather than the production CMS, then use this command:

npm run develop:staging

If you wish to create a production build, then use this command:

npm run start:production

Hang tight! Building the site can take an average of 20 minutes.

❔ Help and troubleshooting

Sometimes when changing git branches for example you might need to run Gatsby clean.

npm run clean
npm start

About

The public website front-end

Resources

Stars

7 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages