Static site starter
Our recommended static site solution at nib is Gatsby, and we have a simple starter template
static-site-starter repository has been set up as a template repository and can be used to create your own repo. Try out the template.
Alternatively our starter can be used via the Gatsby cli to set up your new site. As our
static-site-starter GitHub repository is private, we are restricted to referencing it locally when creating a new gatsby site via the CLI.
Clone the repository:
git clone [email protected]:nib-group/static-site-starter.git
Run from your CLI:
npx gatsby new landing-page ../path/to/static-site-starter
Now install and run:
cd landing-pagenpm installnpm run develop
http://localhost:8000/ to view your static site.
To see a preview of the production build, simply run:
npm run buildnpm run serve
http://localhost:9000/ to view your production build.
Note: Due to the path-prefix, assets (client side JS, images, fonts) will likely not load locally. The same behaviour is experienced in kaos when accesses the static site directly from s3. To see a working site you must also configure the location in the nib-www-router.
There are a number of places where you will need to update your site name after spinning up your new gatsby site based upon this starter.
gatsby-config.js- pathPrefix and title
README.md- title, url, plus remove all unnecessary information
src/metrics/mapMetricsToProps.js- update tealium data layer attributes
remember to update at least the
pageNameattribute on each page!
The starter has a familiar
/.buildkite directory with an
pipeline.yml for pipeline management.
There is a prepush hook that formats your code with prettier and runs unit tests.
The test script for this starter also runs npm's audit script.
It is set to fail for any
Critical known vulnerabilities found.
If your build is failing for this reason, try running
npm audit fix to see if issues can be resolved within semver ranges specified in your
If not, you will need to run
npm audit fix --force and read the change logs for each major bump and make code changes as required.