]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
source: Expose GitInfo Body
authorPeskyPotato <peskypotato@protonmail.com>
Fri, 5 Jul 2024 12:02:23 +0000 (12:02 +0000)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 6 Jul 2024 14:28:11 +0000 (16:28 +0200)
Updated bep/gitmap to v1.4.0, to get commit message's Body.
Added Body to GitInfo struct. Docs upated with commit body example.

Fixes #10905

docs/content/en/methods/page/GitInfo.md
go.mod
go.sum
source/fileInfo.go

index 9dba2a2b20eb01216a748622809a9e5f1d78320d..c54a77371e87a8315f1de8495b9e318057b33e9d 100644 (file)
@@ -113,6 +113,16 @@ This is configurable. See&nbsp;[details].
 {{ end }}
 ```
 
+###### Body
+
+(`string`) The commit message body.
+
+```go-html-template
+{{ with .GitInfo }}
+  {{ .Body }} → - Two new pages added.
+{{ end }}
+```
+
 ## 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.
diff --git a/go.mod b/go.mod
index 5a10b2480aabaa53a15410e3ace4c0d45a4904d9..c2aabcf06055ff367c54788eceb58495b62ac2a7 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -8,7 +8,7 @@ require (
        github.com/aws/aws-sdk-go-v2/service/cloudfront v1.35.4
        github.com/bep/clocks v0.5.0
        github.com/bep/debounce v1.2.0
-       github.com/bep/gitmap v1.1.2
+       github.com/bep/gitmap v1.4.0
        github.com/bep/goat v0.5.0
        github.com/bep/godartsass v1.2.0
        github.com/bep/godartsass/v2 v2.0.0
diff --git a/go.sum b/go.sum
index ea4788a9727492ea42a936a8d801f79c8dfa5aa9..5e94def05afebd6b87fc38e2f11547ca6dc279a5 100644 (file)
--- a/go.sum
+++ b/go.sum
@@ -118,8 +118,8 @@ github.com/bep/clocks v0.5.0 h1:hhvKVGLPQWRVsBP/UB7ErrHYIO42gINVbvqxvYTPVps=
 github.com/bep/clocks v0.5.0/go.mod h1:SUq3q+OOq41y2lRQqH5fsOoxN8GbxSiT6jvoVVLCVhU=
 github.com/bep/debounce v1.2.0 h1:wXds8Kq8qRfwAOpAxHrJDbCXgC5aHSzgQb/0gKsHQqo=
 github.com/bep/debounce v1.2.0/go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3ISbCJ0=
-github.com/bep/gitmap v1.1.2 h1:zk04w1qc1COTZPPYWDQHvns3y1afOsdRfraFQ3qI840=
-github.com/bep/gitmap v1.1.2/go.mod h1:g9VRETxFUXNWzMiuxOwcudo6DfZkW9jOsOW0Ft4kYaY=
+github.com/bep/gitmap v1.4.0 h1:GeWbPb2QDTfcZLBQmCB693N3sJmPQfeu81fDrD5r8x8=
+github.com/bep/gitmap v1.4.0/go.mod h1:n+3W1f/rot2hynsqEGxGMErPRgT41n9CkGuzPvz9cIw=
 github.com/bep/goat v0.5.0 h1:S8jLXHCVy/EHIoCY+btKkmcxcXFd34a0Q63/0D4TKeA=
 github.com/bep/goat v0.5.0/go.mod h1:Md9x7gRxiWKs85yHlVTvHQw9rg86Bm+Y4SuYE8CTH7c=
 github.com/bep/godartsass v1.2.0 h1:E2VvQrxAHAFwbjyOIExAMmogTItSKodoKuijNrGm5yU=
index efe88a2c11a9d4da52fbed28ee3721221f55bce4..3a95a0593df35b19b2de3a4f5a6b9f99605efda6 100644 (file)
@@ -175,6 +175,8 @@ type GitInfo struct {
        AuthorDate time.Time `json:"authorDate"`
        // The commit date.
        CommitDate time.Time `json:"commitDate"`
+       // The commit message's body.
+       Body string `json:"body"`
 }
 
 // IsZero returns true if the GitInfo is empty,