implement pagination

This commit is contained in:
Yihui Xie 2017-10-26 21:59:26 -05:00
parent b76b60eb94
commit 7830711c21
2 changed files with 8 additions and 1 deletions

View file

@ -9,12 +9,14 @@
<ul>
{{ $pages := .Pages }}
{{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }}
{{ range (where $pages "Section" "!=" "") }}
{{ $paginator := .Paginate (where $pages "Section" "!=" "") }}
{{ range $paginator.Pages }}
<li>
<span class="date">{{ .Date.Format "2006/01/02" }}</span>
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
</li>
{{ end }}
</ul>
{{ template "_internal/pagination.html" . }}
{{ partial "footer.html" . }}

View file

@ -22,6 +22,11 @@ hr {
color: #ddd;
}
/* pagination */
.pagination { text-align: center; }
.pagination li { display: inline; }
.pagination a { padding: 0 .2em; }
/* code */
pre {
border: 1px solid #ddd;