Skip to content

Commit

Permalink
add post count
Browse files Browse the repository at this point in the history
  • Loading branch information
orianna-zzo committed Sep 23, 2018
1 parent b788e52 commit ed5283d
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 6 deletions.
5 changes: 5 additions & 0 deletions i18n/en.yaml
Expand Up @@ -18,3 +18,8 @@

- id: nextPost
translation: "Next"

- id: postCount
translation:
one: "One post"
other: "{{ .Count }} posts"
5 changes: 4 additions & 1 deletion i18n/zh-Hans.yaml
Expand Up @@ -15,4 +15,7 @@
translation: "上一篇"

- id: nextPost
translation: "下一篇"
translation: "下一篇"

- id: postCount
translation: "共有{{ .Count }}篇文章"
13 changes: 11 additions & 2 deletions layouts/_default/list.html
Expand Up @@ -20,8 +20,17 @@
<div class="container content mt-3">
{{ end }}
<ul>
{{ partial "page-heading.html" . }}

<div class="div-x">
{{ partial "page-heading.html" . }}
{{ $page_num := (len .Data.Pages)}}
{{ if gt $page_num 0 }}
<div class="px-2 middot"></div>
<div>
{{ i18n "postCount" $page_num }}
</div>
{{ end }}
</div>

{{ if .Content }}
<div class="post-content markdown">
{{ .Content }}
Expand Down
11 changes: 10 additions & 1 deletion layouts/_default/taxonomy.html
Expand Up @@ -19,7 +19,16 @@
<!-- <div class="content"> -->
<div class="col-md-9 mt-3">
<ul>
{{ partial "page-heading.html" . }}
<div class="div-x">
{{ partial "page-heading.html" . }}
{{ $page_num := (len .Data.Pages)}}
{{ if gt $page_num 0 }}
<div class="px-2 middot"></div>
<div>
{{ i18n "postCount" $page_num }}
</div>
{{ end }}
</div>

{{ if .Content }}
<div class="post-content markdown">
Expand Down
5 changes: 3 additions & 2 deletions static/css/main.css
Expand Up @@ -208,7 +208,8 @@ a:hover.post-meta, a:active.post-meta {
content: "•";
}

.post-meta .middot {
.div-x .middot,
.li-x .middot {
font-size: 6px;
margin: 0;
padding: 0;
Expand Down Expand Up @@ -1125,7 +1126,7 @@ toc-nav scrollspy


/*
temp
temp term list
*/

.post-item {
Expand Down

0 comments on commit ed5283d

Please sign in to comment.