Skip to content

Commit

Permalink
fix: whitespace problem in site-info in footer
Browse files Browse the repository at this point in the history
  • Loading branch information
reuixiy committed Nov 18, 2019
1 parent aa106a7 commit f471af6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 2 additions & 0 deletions config-examples/en-us/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,8 @@ uglyURLs = false

displaySiteCreatedYear = true

# Leave it empty("") if you don’t want
# the icon
iconBetweenYearAndAuthor = "heart"
iconColor = "#f06292"
# Enable heartbeat animation?
Expand Down
14 changes: 7 additions & 7 deletions config-examples/zh-cn/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -733,10 +733,10 @@ uglyURLs = false
######################################
## 字体

# 说明:任何一项留空,浏览器都会回退到主体字
# `fontFamilyBody`,故没必要全部
# 设置。此外,如果你的品牌栏用的 SVG,
# 则可留空品牌栏字体
# 说明:任何一项留空(""),浏览器都会回退到
# 主体字体 `fontFamilyBody`,故没必
# 要全部设置。此外,如果你的品牌栏用的
# SVG,则可留空("")品牌栏字体

# 品牌栏
fontFamilySiteBrand = ""
Expand Down Expand Up @@ -765,7 +765,7 @@ uglyURLs = false
# 采用网络字体。MemE 主题目前仅支持
# Google Fonts 的链接,请前往
# https://fonts.google.com/ 获取。
# 此项留空,则不会采用网络字体。
# 此项留空(""),则不会采用网络字体。

######################################
## 字号(单位:px)
Expand Down Expand Up @@ -993,7 +993,7 @@ uglyURLs = false
# 是否显示站点的创建年份
displaySiteCreatedYear = true

# 年份与作者之间的图标
# 年份与作者之间的图标,留空("")则无
iconBetweenYearAndAuthor = "heart"
# 图标颜色
iconColor = "#f06292"
Expand Down Expand Up @@ -1049,4 +1049,4 @@ uglyURLs = false
# 视频地址
fofVideoWebm = ""
fofVideoMp4 = ""
# 说明:视频地址可留空
# 说明:视频地址可留空("")
12 changes: 7 additions & 5 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<footer id="footer" class="footer">
<div class="footer-inner">
{{ if .Site.Params.displayCopyrightSymbol }}
{{ .Scratch.Set "siteInfoCopyright" "©" }}
{{ .Scratch.Set "siteInfoCopyright" "©&nbsp;" }}
{{ else }}
{{ .Scratch.Set "siteInfoCopyright" "" }}
{{ end }}
Expand All @@ -15,12 +15,14 @@
{{ end }}
{{ $siteInfoCreatedYear := .Scratch.Get "siteInfoCreatedYear" }}

{{ with .Site.Params.iconBetweenYearAndAuthor | default "heart" }}
{{ $.Scratch.Set "siteInfoIcon" (index $.Site.Data.SVG .) }}
{{ with .Site.Params.iconBetweenYearAndAuthor }}
{{ $.Scratch.Set "siteInfoIcon" (replace (index $.Site.Data.SVG .) "icon" "icon footer-icon") }}
{{ else }}
{{ $.Scratch.Set "siteInfoIcon" "&nbsp;" }}
{{ end }}
{{ $siteInfoIcon := (replace (.Scratch.Get "siteInfoIcon") "icon" "icon footer-icon") }}
{{ $siteInfoIcon := .Scratch.Get "siteInfoIcon" }}

<div class="site-info">{{ printf `%s %s%s%s` $siteInfoCopyright $siteInfoCreatedYear $siteInfoIcon .Site.Author.name | safeHTML }}</div>
<div class="site-info">{{ printf `%s%s%s%s` $siteInfoCopyright $siteInfoCreatedYear $siteInfoIcon .Site.Author.name | safeHTML }}</div>

{{ if .Site.Params.displayPoweredBy }}
<div class="powered-by">{{ printf `Powered by [Hugo](https://github.com/gohugoio/hugo) | Theme is [MemE](https://github.com/reuixiy/hugo-theme-meme)` | markdownify | safeHTML }}</div>
Expand Down

0 comments on commit f471af6

Please sign in to comment.