mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-10 01:44:46 -04:00
source: Expose Ancestor in GitInfo
Also updates docs and bumps bep/gitmap to v1.7.0 Closes #5693 Co-authored-by: bep <bjorn.erik.pedersen@gmail.com>
This commit is contained in:
parent
60dd993a65
commit
68620a6c28
@ -117,6 +117,22 @@ hugo --enableGitInfo
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
###### Ancestor
|
||||||
|
|
||||||
|
(`*source.GitInfo`) The file-filtered ancestor commit, if any.
|
||||||
|
|
||||||
|
```go-html-template
|
||||||
|
{{ partial "inline/changelog.html" .GitInfo }} → 2023-10-09: Add tutorials
|
||||||
|
2025-03-26: Edit GitInfo docs
|
||||||
|
|
||||||
|
{{ define "_partials/inline/changelog.html" }}
|
||||||
|
{{ with . }}
|
||||||
|
{{ partial "inline/changelog.html" .Ancestor }}
|
||||||
|
{{ .CommitDate.Format "2006-01-02" }}: {{ .Subject }}<br>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
```
|
||||||
|
|
||||||
## Last modified date
|
## Last modified date
|
||||||
|
|
||||||
By default, when `enableGitInfo` is `true`, the `Lastmod` method on a `Page` object returns the Git AuthorDate of the last commit that included the file.
|
By default, when `enableGitInfo` is `true`, the `Lastmod` method on a `Page` object returns the Git AuthorDate of the last commit that included the file.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user