feat(lastUpdated): introduce last modified author using GitInfo (#857)

* feat(lastUpdated): introduce last modified author using GitInfo

* feat: change by string for just •

* docs: add documentation for displayUpdatedAuthor parameter

Document the new displayUpdatedAuthor config option in all language
versions (en, zh-cn, ja, fa). Also disable it by default in the
example hugo.yaml.

---------

Co-authored-by: Xin <5097752+imfing@users.noreply.github.com>
Co-authored-by: Xin <xin@imfing.com>
This commit is contained in:
Daniel Seijo
2026-02-01 16:02:15 +01:00
committed by GitHub
parent 744e843880
commit 9362f7c3fc
6 changed files with 28 additions and 1 deletions

View File

@@ -285,6 +285,8 @@ params:
برای سفارشی کردن فرمت تاریخ، پارامتر `params.dateFormat` را تنظیم کنید. چیدمان آن با [`time.Format`](https://gohugo.io/functions/time/format/) Hugo مطابقت دارد.
علاوه بر این، می‌توانید با فعال کردن پرچم `params.displayUpdatedAuthor` نویسنده آخرین تغییر را نمایش دهید. این نیاز به تنظیم `enableGitInfo: true` دارد.
```yaml {filename="hugo.yaml"}
# تجزیه commit Git
enableGitInfo: true
@@ -293,6 +295,8 @@ params:
# نمایش تاریخ آخرین تغییر
displayUpdatedDate: true
dateFormat: "January 2, 2006"
# نمایش نویسنده آخرین تغییر
displayUpdatedAuthor: true
```
### برچسب‌ها

View File

@@ -285,6 +285,8 @@ params:
日付形式をカスタマイズするには、`params.dateFormat` パラメータを設定します。そのレイアウトは Hugo の [`time.Format`](https://gohugo.io/functions/time/format/) に準拠します。
さらに、`params.displayUpdatedAuthor` フラグを有効にすると、最終更新の作者を表示できます。これには `enableGitInfo: true` の設定が必要です。
```yaml {filename="hugo.yaml"}
# Git コミットを解析
enableGitInfo: true
@@ -293,6 +295,8 @@ params:
# 最終更新日を表示
displayUpdatedDate: true
dateFormat: "2006年1月2日"
# 最終更新の作者を表示
displayUpdatedAuthor: true
```
### タグ

View File

@@ -307,6 +307,8 @@ The date of the page's last modification can be displayed by enabling the `param
To customize the date format, set the `params.dateFormat` parameter. Its layout matches Hugo's [`time.Format`](https://gohugo.io/functions/time/format/).
Additionally, the author of the last modification can be displayed by enabling the `params.displayUpdatedAuthor` flag. This requires `enableGitInfo: true` to be set.
```yaml {filename="hugo.yaml"}
# Parse Git commit
enableGitInfo: true
@@ -315,6 +317,8 @@ params:
# Display the last modification date
displayUpdatedDate: true
dateFormat: "January 2, 2006"
# Display the author of the last modification
displayUpdatedAuthor: true
```
### Tags

View File

@@ -285,6 +285,8 @@ params:
要自定义日期格式,设置 `params.dateFormat` 参数。其布局与 Hugo 的 [`time.Format`](https://gohugo.io/functions/time/format/) 匹配。
此外,可以通过启用 `params.displayUpdatedAuthor` 标志来显示最后修改的作者。这需要设置 `enableGitInfo: true`。
```yaml {filename="hugo.yaml"}
# 解析 Git 提交
enableGitInfo: true
@@ -293,6 +295,8 @@ params:
# 显示最后修改日期
displayUpdatedDate: true
dateFormat: "2006年1月2日"
# 显示最后修改的作者
displayUpdatedAuthor: true
```
### 标签

View File

@@ -194,6 +194,9 @@ params:
displayUpdatedDate: true
dateFormat: "January 2, 2006"
# Display the author name of the last modified date
displayUpdatedAuthor: false
# Search
# flexsearch is enabled by default
search: