diff options
-rw-r--r-- | exampleSite/config.toml | 4 | ||||
-rw-r--r-- | layouts/partials/post/copyright.html | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 8fed952..4ebad8b 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -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值 diff --git a/layouts/partials/post/copyright.html b/layouts/partials/post/copyright.html index cd42d68..35a7609 100644 --- a/layouts/partials/post/copyright.html +++ b/layouts/partials/post/copyright.html @@ -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" -}} @@ -29,4 +32,4 @@ </p> {{- end }} </div> -{{- end }}
\ No newline at end of file +{{- end }} |