mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-10 13:11:36 -04:00
Add Ancestors (plural) method to GitInfo, rename Ancestor field to Parent
Fixes #13839
This commit is contained in:
parent
68620a6c28
commit
4e71546d19
@ -117,22 +117,22 @@ hugo --enableGitInfo
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Ancestor
|
### Ancestors
|
||||||
|
|
||||||
(`*source.GitInfo`) The file-filtered ancestor commit, if any.
|
(`*source.GitInfo`) The file-filtered ancestor commits, if any.
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ partial "inline/changelog.html" .GitInfo }} → 2023-10-09: Add tutorials
|
{{ with .GitInfo }}
|
||||||
2025-03-26: Edit GitInfo docs
|
{{ range .Ancestors | first 5 }}
|
||||||
|
{{ .CommitDate.Format "2006-01-02" }}: {{ .Subject }}
|
||||||
{{ define "_partials/inline/changelog.html" }}
|
|
||||||
{{ with . }}
|
|
||||||
{{ partial "inline/changelog.html" .Ancestor }}
|
|
||||||
{{ .CommitDate.Format "2006-01-02" }}: {{ .Subject }}<br>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Parent
|
||||||
|
|
||||||
|
(`*source.GitInfo`) The first file-filtered ancestor commit, if any.
|
||||||
|
|
||||||
## 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