Hugo provides a way to integrate Git data into your site.
- The Hugo site must be in a Git-enabled directory.
- The Git executable must be installed and in your system
- Enable the GitInfo feature in Hugo by using
--enableGitInfoon the command line or by setting
truein your site configuration.
The GitInfo Object
GitInfo object contains the following fields:
- abbreviated commit hash, e.g.
- author name, respecting
- author email address, respecting
- the author date
- commit hash, e.g.
- commit message subject, e.g.
tpl: Add custom index function
The Git integrations should be fairly performant, but it does add some time to the build, which depends somewhat on the Git history size.