Add pagination for taxonomies. Close #20
This commit is contained in:
parent
82727c8e8a
commit
9ea38661fb
@ -10,7 +10,7 @@
|
|||||||
<header>
|
<header>
|
||||||
<h2 class="post-title{{ if .Params.favorite }} favorite{{end}}"><a href="{{ .RelPermalink }}">{{ trim .Title " " }}</a></h2>
|
<h2 class="post-title{{ if .Params.favorite }} favorite{{end}}"><a href="{{ .RelPermalink }}">{{ trim .Title " " }}</a></h2>
|
||||||
</header>
|
</header>
|
||||||
{{ partial "postInfoFull.html" . }}
|
{{ partial "postInfo.html" . }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</div>
|
</div>
|
||||||
{{ partial "postInfoFull.html" . }}
|
{{ partial "postInfo.html" . }}
|
||||||
</article>
|
</article>
|
||||||
{{ if .Site.DisqusShortname }}
|
{{ if .Site.DisqusShortname }}
|
||||||
{{ template "_internal/disqus.html" . }}
|
{{ template "_internal/disqus.html" . }}
|
||||||
|
11
layouts/_default/taxonomy.html
Normal file
11
layouts/_default/taxonomy.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{{ define "main" }}
|
||||||
|
<h1>{{ i18n .Data.Singular | humanize }}: {{ .Title }}</h1>
|
||||||
|
<div class="post-info">
|
||||||
|
<a href="{{ (printf "%s/%s" .Site.LanguagePrefix .Data.Plural) | absLangURL }}">{{ i18n (printf "toAll%s" (.Data.Plural | humanize )) | humanize }}</a>
|
||||||
|
</div>
|
||||||
|
{{ range .Paginator.Pages }}
|
||||||
|
{{ partial "postSummary.html" . }}
|
||||||
|
{{ end }}
|
||||||
|
{{ partial "pagination.html" . }}
|
||||||
|
|
||||||
|
{{ end }}
|
@ -1,19 +1,15 @@
|
|||||||
{{ if or ( .Paginator.HasPrev ) ( .Paginator.HasNext ) }}
|
{{ if or ( .Paginator.HasPrev ) ( .Paginator.HasNext ) }}
|
||||||
{{ $toNewPostsMessage := i18n "toNewPosts" | humanize }}
|
{{ $toNewPostsMessage := i18n "toNewPosts" | humanize }}
|
||||||
{{ $toOldPostsMessage := i18n "toOldPosts" | humanize }}
|
{{ $toOldPostsMessage := i18n "toOldPosts" | humanize }}
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
<div class="left pagination-item {{ if not .Paginator.HasPrev }}disabled{{ end }}">
|
<div class="left pagination-item {{ if not .Paginator.HasPrev }}disabled{{ end }}">
|
||||||
{{ if .Paginator.HasPrev }}
|
{{ if .Paginator.HasPrev }}
|
||||||
{{ if eq .Paginator.PageNumber 2 }}
|
|
||||||
<a href="{{ .Site.BaseURL }}{{ .Site.LanguagePrefix}}">{{ $toNewPostsMessage }}</a>
|
|
||||||
{{ else }}
|
|
||||||
<a href="{{ .Paginator.Prev.URL | relLangURL }}">{{ $toNewPostsMessage }}</a>
|
<a href="{{ .Paginator.Prev.URL | relLangURL }}">{{ $toNewPostsMessage }}</a>
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
<div class="right pagination-item {{ if not .Paginator.HasNext }}disabled{{ end }}">
|
<div class="right pagination-item {{ if not .Paginator.HasNext }}disabled{{ end }}">
|
||||||
{{ if .Paginator.HasNext }}
|
{{ if .Paginator.HasNext }}
|
||||||
<a href="{{ .Paginator.Next.URL | relLangURL }}">{{ $toOldPostsMessage }}</a>
|
<a href="{{ .Paginator.Next.URL | relLangURL }}">{{ $toOldPostsMessage }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -12,5 +12,5 @@
|
|||||||
</div>
|
</div>
|
||||||
{{ end }} -->
|
{{ end }} -->
|
||||||
|
|
||||||
{{ partial "postInfoFull.html" . }}
|
{{ partial "postInfo.html" . }}
|
||||||
</article>
|
</article>
|
@ -1,11 +0,0 @@
|
|||||||
{{ define "main" }}
|
|
||||||
|
|
||||||
<h1>{{ i18n "category" | humanize }}: {{ .Title }}</h1>
|
|
||||||
<div class="post-info">
|
|
||||||
<a href="{{ "categories/" | absLangURL }}">{{ i18n "toAllCategories" | humanize }}</a>
|
|
||||||
</div>
|
|
||||||
{{ range .Data.Pages }}
|
|
||||||
{{ partial "postSummary.html" . }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{ end }}
|
|
@ -1,11 +0,0 @@
|
|||||||
{{ define "main" }}
|
|
||||||
|
|
||||||
<h1>{{ i18n "tag" | humanize }}: {{ .Title }}</h1>
|
|
||||||
<div class="post-info">
|
|
||||||
<a href="{{ "tags/" | absURL }}">{{ i18n "toAllTags" | humanize}}</a>
|
|
||||||
</div>
|
|
||||||
{{ range .Data.Pages }}
|
|
||||||
{{ partial "postSummary.html" . }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{ end }}
|
|
Loading…
Reference in New Issue
Block a user