Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-11-02 01:04:12 +0300
committerGitHub <noreply@github.com>2016-11-02 01:04:12 +0300
commite8380e612fae18493556d620726a9069a17128db (patch)
treee7aa175227a5748a65b667734bb080a75a43d69e /docs
parent186db7cd7ad56051d5a064ee5120e6ec73f575a0 (diff)
Add GitInfo
This commit adds a `GitInfo` object to `Page` if `EnableGitInfo` is set. It then also sets `Lastmod` for the given `Page` to the author date provided by Git. The Git integrations should be fairly performant, but it adds "some time" to the build, somewhat depending on the Git history size. If you want, you can run without during development and turn it on when deploying to the live server: `hugo --enableGitInfo`. Fixes #2102
Diffstat (limited to 'docs')
-rw-r--r--docs/config.toml1
-rw-r--r--docs/layouts/partials/footer.html2
2 files changed, 2 insertions, 1 deletions
diff --git a/docs/config.toml b/docs/config.toml
index b5d159334..17161dd5e 100644
--- a/docs/config.toml
+++ b/docs/config.toml
@@ -2,6 +2,7 @@ title = "Hugo: A Fast and Flexible Website Generator"
baseurl = "http://gohugo.io/"
MetaDataFormat = "yaml"
pluralizeListTitles = false
+enableGitInfo = true
[blackfriday]
plainIDAnchors = true
diff --git a/docs/layouts/partials/footer.html b/docs/layouts/partials/footer.html
index 6756e57cf..2d0dbe0e8 100644
--- a/docs/layouts/partials/footer.html
+++ b/docs/layouts/partials/footer.html
@@ -1,6 +1,6 @@
<div class="row">
<div class="footer-panel">
- <p>Last revision: {{ .Lastmod.Format "January 2, 2006" }}
+ <p>Last revision: {{ .Lastmod.Format "January 2, 2006" }}{{ if .IsPage }}<em>{{ with .GitInfo }}| {{ .Subject }} | {{ .AbbreviatedHash }}{{end }}</em>{{ end }}
<span style="float: right;">Hugo v{{ .Hugo.Version }} documentation</span>
</p>
</div>