mirror of
https://git.adityakumar.xyz/hugo-theme-even.git
synced 2024-11-08 22:49:44 +00:00
feat(lastmod): use git commit to generate lastmod info (#124)
This commit is contained in:
parent
915174fdba
commit
920e2eb84b
2 changed files with 9 additions and 2 deletions
|
@ -6,6 +6,7 @@ preserveTaxonomyNames = true
|
|||
enableRobotsTXT = true
|
||||
enableEmoji = true
|
||||
theme = "even"
|
||||
enableGitInfo = false # use git commit log to generate lastmod record # 可根据 Git 中的提交生成最近更新记录。
|
||||
|
||||
# Syntax highlighting by Chroma. NOTE: Don't enable `highlightInClient` and `chroma` at the same time!
|
||||
pygmentsOptions = "linenos=table"
|
||||
|
@ -53,6 +54,9 @@ copyright = "" # default: author.name ↓ # 默认为下面配
|
|||
debug = false # If true, load `eruda.min.js`. See https://github.com/liriliri/eruda
|
||||
|
||||
since = "2017" # Site creation time # 站点建立时间
|
||||
# use public git repo url to link lastmod git commit, enableGitInfo should be true.
|
||||
# 指定 git 仓库地址,可以生成指向最近更新的 git commit 的链接,需要将 enableGitInfo 设置成 true.
|
||||
gitRepo = ""
|
||||
|
||||
# site info (optional) # 站点信息(可选,不需要的可以直接注释掉)
|
||||
logoTitle = "Even" # default: the title value # 默认值: 上面设置的title值
|
||||
|
|
|
@ -6,7 +6,10 @@
|
|||
</p>
|
||||
<p class="copyright-item">
|
||||
<span class="item-title">{{ T "lastMod" }}</span>
|
||||
<span class="item-content">{{ .Lastmod.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}</span>
|
||||
<span class="item-content">
|
||||
{{ .Lastmod.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}
|
||||
{{ with .GitInfo }}<a href="{{ $.Site.Params.gitRepo }}/commit/{{ .Hash }}" title="{{ .Subject }}">({{ .AbbreviatedHash }})</a>{{ end }}
|
||||
</span>
|
||||
</p>
|
||||
{{ if $.Site.Params.linkToMarkDown -}}
|
||||
{{ with $.OutputFormats.Get "markdown" -}}
|
||||
|
|
Loading…
Reference in a new issue