HB 修訂模塊

描述頁面的額外信息,如創建日期、修改日期等。

本頁內容

Modulegithub.com/hbstack/revision
Repository⭐ Please consider giving a star if your like it.
Stars
Version
Used by
Requirements
License
UsageSee how to use modules.

模板

模板 hb/modules/revision/index 接受當前頁面變量作為上下文。

1{{- partial "hb/modules/revision/index" . }}

站點參數

hugo.toml

1[hb]
2  [hb.revision]
3    created_at = true
4    date_format = ':date_full'
5    font_size = '.825rem'
6    icons = true

hugo.yaml

1hb:
2  revision:
3    created_at: true
4    date_format: :date_full
5    font_size: .825rem
6    icons: true

hugo.json

 1{
 2   "hb": {
 3      "revision": {
 4         "created_at": true,
 5         "date_format": ":date_full",
 6         "font_size": ".825rem",
 7         "icons": true
 8      }
 9   }
10}
NameTypeDefaultRequiredDescription
date_formatstring:date_full-另請參閱 time.Format
iconsbooleantrue-是否顯示圖標。
font_sizestring.825rem-文本字體大小。
created_atbooleantrue-false 時,隱藏創建日期。
repo_servicestring--支持 github
repo_ownerstring--倉庫所有者。
repo_namestring--倉庫名稱。
repo_branchstringmaster-默認分支。
repo_subpathstring--子路徑。
repo_contributorsbooleanfalse-是否顯示貢獻者。
repo_actionsbooleantrue-是否顯示編輯、查看和歷史按鈕。

您需要設置 GITHUB_TOKEN 環境變量,以避免在啟用 repo_contributors 時遇到 GitHub API 的速率限制問題。

razonyang
2024年7月26日 星期五 2023年12月22日 星期五