f3c88b08Add warning on GitInfo and Shallow Clonesfa5be591Make the two common Taxonomy templates explicit4a81c507Update pull request link in showcase.htmlf751e57aUpdate christianmendoza.me in the showcased582419bRemove commit message prefix from showcase addition guided12791cfFix path for screenshot in showcase addition guidee487b916Add invincible.site to the showcasec85cfccfUpdate guide for showcase additionsc44b31c1Fix spellingdc10d7f6Add slightly better GitHub install description2611980fRevert "Add workaround to Fetch from GitHub documentation"b2e56907Fix Git commit link in footerb025a638Regenerate commands docs for v0.24.10741ad08Update README.md942d130aAdd branch info to READMEe8c36390Set hugoDocs/master to 0.24.1c4e21471Add workaround to Fetch from GitHub documentationdb0a3c08Fix typo in release note git-subtree-dir: docs git-subtree-split:f3c88b0810
1.8 KiB
aliases, lastmod, date, menu, next, prev, title
| aliases | lastmod | date | menu | next | prev | title | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
2016-12-11 | 2016-12-11 |
|
/extras/livereload | /extras/datadrivencontent | GitInfo |
Hugo provides a way to integrate Git data into your site.
Prerequisites
- The Hugo site must be in a Git-enabled directory.
- The Git executable must be installed and in your system
PATH. - Enable the GitInfo feature in Hugo by using
--enableGitInfoon the command line or by settingenableGitInfototruein your site configuration.
The GitInfo Object
The GitInfo object contains the following fields:
- AbbreviatedHash
- abbreviated commit hash, e.g.
866cbcc - AuthorName
- author name, respecting
.mailmap - AuthorEmail
- author email address, respecting
.mailmap - AuthorDate
- the author date
- Hash
- commit hash, e.g.
866cbccdab588b9908887ffd3b4f2667e94090c3 - Subject
- commit message subject, e.g.
tpl: Add custom index function
Other Considerations
The Git integrations should be fairly performant, but it does add some time to the build, which depends somewhat on the Git history size.
The accuracy of data depends on the underlying local git respository. If the local repository is a shallow clone, then any file that hasn't been modified in the truncated history will default to data in the oldest commit. In particular, if the respository has been cloned using --depth=1 then every file will the exact same GitInfo data -- that of the only commit in the repository.
In particular, many CI/CD systems such as travis-ci.org default to a clone depth of 50 which is unlikely to be deep enough. You can explicitly add back the missing history using using git fetch --unshallow or make the initial checkout deeper.