Description
Add the latest commit ID (scoped to the website/ folder) to the homepage footer, so we can determine which commit was used to build the currently deployed site.
The commit hash is displayed as a clickable link pointing to the commit on GitHub, placed below the Netlify icon and text in the footer's right section.
Implementation:
- Inject
HUGO_PARAMS_COMMITFULL and HUGO_PARAMS_COMMITSHORT env vars via git log -1 --format=%H -- . at build time in npm run build/dev scripts
- Footer template reads
site.Params.commitfull / site.Params.commitshort and renders a link using site.docsRepo config for the base URL
- Graceful fallback: nothing shown if env vars not set
Done Criteria
Description
Add the latest commit ID (scoped to the
website/folder) to the homepage footer, so we can determine which commit was used to build the currently deployed site.The commit hash is displayed as a clickable link pointing to the commit on GitHub, placed below the Netlify icon and text in the footer's right section.
Implementation:
HUGO_PARAMS_COMMITFULLandHUGO_PARAMS_COMMITSHORTenv vars viagit log -1 --format=%H -- .at build time innpm run build/devscriptssite.Params.commitfull/site.Params.commitshortand renders a link usingsite.docsRepoconfig for the base URLDone Criteria
npm run buildnpm run devduring local development