feat(config): configure to show archive count

Close #46
This commit is contained in:
olOwOlo 2018-06-01 00:36:52 +08:00
parent 6766e09744
commit 2c7773b9cb
No known key found for this signature in database
GPG key ID: 456394B6E7A15EA6
6 changed files with 7 additions and 5 deletions

View file

@ -56,6 +56,9 @@ copyright = "" # default: author.name ↓ # 默认为下面配
# paginate of archives, tags and categories # 归档、标签、分类每页显示的文章数目,建议修改为一个较大的值
archivePaginate = 5
# show 'xx Posts In Total' in archive page ? # 是否在归档页显示文章的总数
showArchiveCount = false
# The date format to use; for a list of valid formats, see https://gohugo.io/functions/format/
dateFormatToUse = "2006-01-02"

View file

@ -3,7 +3,7 @@
{{ define "content"}}
{{- $paginator := .Paginate .Data.Pages.ByDate.Reverse .Site.Params.archivePaginate }}
<section id="archive" class="archive">
{{- if not $paginator.HasPrev }}
{{- if and (not $paginator.HasPrev) .Site.Params.showArchiveCount }}
<div class="archive-title">
<span class="archive-post-counter">
{{ T "archiveCounter" (len .Data.Pages) }}

View file

@ -62,7 +62,7 @@
{{ with .PrevInSection }}
<a class="next" href="{{ .URL }}">
<span class="next-text nav-default">{{ .Title }}</span>
<span class="prev-text nav-mobile">{{ T "nextPost" }}</span>
<span class="next-text nav-mobile">{{ T "nextPost" }}</span>
<i class="iconfont icon-right"></i>
</a>
{{- end }}

View file

@ -23,7 +23,6 @@
}
.archive-post-counter {
display: none;
color: $dark-gray;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long