diff options
author | Michael Romero <halogenica@users.noreply.github.com> | 2019-09-05 07:40:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-05 07:40:58 +0300 |
commit | f6ae4712817b094afa6217b71ef4d8792ccd667f (patch) | |
tree | bb76314df2ca5935f4b287703db8a66aec6ddbc5 /README.md | |
parent | d7d28f8aa27005139d050505bf2a2c13c645dd7c (diff) | |
parent | 09f5875f0308b9a49e2abe32f8dd76beca15655a (diff) |
Merge pull request #235 from VincentTam/gitCommit
[Enhancement]: Use Hugo's built-in GitInfo for Git commit SHA on the footer
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -112,20 +112,15 @@ To add Google Analytics, simply sign up to [Google Analytics](https://www.google ### Commit SHA on the footer -If the source of your site is in a Git repo, the SHA corresponding to the commit the site is built from can be shown on the footer. To do so, two environment variables have to be set (`GIT_COMMIT_SHA` and `GIT_COMMIT_SHA_SHORT`) and parameter `commit` has to be defined in the config file: +If the source of your site is in a Git repo, the SHA corresponding to the commit the site is built from can be shown on the footer. To do so, two site parameters `commit` has to be defined in the config file `config.toml`: ``` +enableGitInfo = true [Params] commit = "https://github.com/<username>/<siterepo>/tree/" ``` - -This can be achieved by running the next command prior to calling Hugo: -``` - GIT_COMMIT_SHA=`git rev-parse --verify HEAD` GIT_COMMIT_SHA_SHORT=`git rev-parse --short HEAD` -``` - -See at [xor-gate/xor-gate.org](https://github.com/xor-gate/xor-gate.org) an example of how to add it to a continuous integration system. +See at [vincenttam/vincenttam.gitlab.io](https://gitlab.com/vincenttam/vincenttam.gitlab.io) for an example of how to add it to a continuous integration system. ### Extra shortcodes |