Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
fix(git): git info in footer
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonzq committed Mar 3, 2020
1 parent 41e27cd commit 66b76b5
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 10 deletions.
18 changes: 17 additions & 1 deletion assets/css/_partial/_single/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -32,10 +48,10 @@
}

.post-info-md {
font-size: 0.8rem;
width: 8rem;

a {
font-size: 0.8rem;
color: $single-link-color;

.dark-theme & {
Expand Down
13 changes: 6 additions & 7 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -268,8 +266,6 @@ enableEmoji = true
keywords = ["Theme", "Hugo"]
# 网站默认主题 ("light", "dark", "auto")
defaultTheme = "auto"
# 用于生成文章上次修改时间的公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效
gitRepo = ""
# 主页信息设置
[languages.zh.params.home]
# 主页个人信息
Expand Down Expand Up @@ -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]
Expand Down
6 changes: 6 additions & 0 deletions layouts/partials/single/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -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="}}

0 comments on commit 66b76b5

Please sign in to comment.