The following development with Hugo will be sufficient for most of the DORA.dev website development efforts. To build and preview the site locally, you'll need hugo (recommended version: v0.133.1).
- The recommended command to start the local hugo server is
hugo serve -D -s hugo --disableFastRender --debug --watch
.- This will render and live-reload all pages, including drafts. To suppress rendering of drafts, omit the
-D
flag.
- This will render and live-reload all pages, including drafts. To suppress rendering of drafts, omit the
- When the hugo server is running, the site can be previewed at
localhost:1313
.
See /ci/README.md
The production site (and pre-prod environments) are hosted in Firebase. Some hosting features (most notably, redirects) are provided by Firebase, and will not be available when the site is served locally by Hugo alone.
Many Firebase features may be run locally through the Firebase emulator. This requires two terminal windows and some knowledge about specific Firebase options desired to test.
To emulate Firestore and Firebase hosting (to see features like server-side redirects)
- in terminal 1, run
watch -n 2 hugo -s hugo -e development
- this will continuously rebuild the site and save it to
/public
(which is the firebase hosting serving root)
- this will continuously rebuild the site and save it to
- in terminal 2, run
firebase emulators:start --only hosting
- access the site at
http://localhost:5000
- in this configuration, the browser will not auto-reload when source files are changed
When deploying Cloud Functions with Cloud Build, you can encounter the following error:
Step #2: functions: Unhandled error cleaning up build images. This could result in a small monthly bill if not corrected. You can attempt to delete these images by redeploying or you can delete them manually at https://console.cloud.google.com/artifacts/docker/{....gcf-artifacts}
Apparently, this is a [known issue](https://github.com/firebase/firebase-tools/issues/3404)