fix(git): git info in footer

This commit is contained in:
Dillon 2020-03-04 01:27:30 +08:00
parent 41e27cd979
commit 66b76b599b
5 changed files with 31 additions and 10 deletions

View file

@ -20,6 +20,22 @@
.dark-theme & {
color: $global-font-secondary-color-dark;
}
a {
color: $single-link-color;
.dark-theme & {
color: $single-link-color-dark;
}
&:hover {
color: $single-link-hover-color;
.dark-theme & {
color: $single-link-hover-color-dark;
}
}
}
}
.post-info-license {
@ -32,10 +48,10 @@
}
.post-info-md {
font-size: 0.8rem;
width: 8rem;
a {
font-size: 0.8rem;
color: $single-link-color;
.dark-theme & {

View file

@ -12,9 +12,9 @@ themesDir = "../.."
# whether to use robots.txt
# 是否使用 robots.txt
enableRobotsTXT = true
# whether to use git commit log to generate lastmod record
# 是否使用 git 信息来生成文章的上次修改时间
enableGitInfo = false
# whether to use git commit log
# 是否使用 git 信息
enableGitInfo = true
# whether to use emoji code
# 是否使用 emoji 代码
enableEmoji = true
@ -67,8 +67,6 @@ enableEmoji = true
keywords = ["Theme", "Hugo"]
# site default theme ("light", "dark", "auto")
defaultTheme = "auto"
# public git repo url to link lastmod git commit only then enableGitInfo is true
gitRepo = ""
# Home Page Info
[languages.en.params.home]
# Home Page Profile
@ -268,8 +266,6 @@ enableEmoji = true
keywords = ["Theme", "Hugo"]
# 网站默认主题 ("light", "dark", "auto")
defaultTheme = "auto"
# 用于生成文章上次修改时间的公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效
gitRepo = ""
# 主页信息设置
[languages.zh.params.home]
# 主页个人信息
@ -426,6 +422,9 @@ enableEmoji = true
# LoveIt theme version
# LoveIt 主题版本
version = "0.1.X"
# public git repo url only then enableGitInfo is true
# 公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效
gitRepo = "https://github.com/dillonzq/LoveIt"
# Header info
# 页面头部导航栏信息
[params.header]

View file

@ -5,6 +5,12 @@
<div class="post-info-mod">
<span>
{{- printf (T "lastMod") $modify_date -}}
{{- with .GitInfo -}}
{{- $gitHash := .Hash -}}
&nbsp;<a class="git-hash" {{ with $.Site.Params.gitRepo }}href="{{ printf `%s/commit/%s` . $gitHash }}" target="_blank"{{ else }}href="javascript:void(0);"{{ end }} title="commit by {{ .AuthorName }}({{ .AuthorEmail }}) {{ $gitHash }}: {{ .Subject }}">
<i class="fas fa-hashtag fa-fw"></i>{{- .AbbreviatedHash -}}
</a>
{{- end -}}
</span>
</div>
<div class="post-info-license">

View file

@ -1 +1 @@
{"Target":"css/style.min.52eef027334e2f9819adcad242e7298beefaf3f468d9085be0327f795ae0e4e5.css","MediaType":"text/css","Data":{"Integrity":"sha256-Uu7wJzNOL5gZrcrSQucpi+768/Ro2Qhb4DJ/eVrg5OU="}}
{"Target":"css/style.min.e9a885b35bab1db17c8dc0846bfea3e8513af60bd9812b4813224384fd65afa7.css","MediaType":"text/css","Data":{"Integrity":"sha256-6aiFs1urHbF8jcCEa/6j6FE69gvZgStIEyJDhP1lr6c="}}