feat(): add support for pagination in _default/list.html

This commit is contained in:
kendo5731 2016-02-04 23:20:36 +01:00
parent f5b5ae55d9
commit f4d8ac34df
4 changed files with 25 additions and 5 deletions

View File

@ -6,7 +6,6 @@ A theme for [Hugo](https://gohugo.io/), inspired by Atom editor.
This repo is a work in progress, there is still work to do, contributions are welcome ! This repo is a work in progress, there is still work to do, contributions are welcome !
- Support pagination in list layout
- Support "dynamic" titles and descriptions - Support "dynamic" titles and descriptions
- Uglify CSS and Javascript - Uglify CSS and Javascript
- Add integration with Disqus - Add integration with Disqus

View File

@ -1,10 +1,12 @@
{{ partial "top.html" . }} {{ partial "top.html" . }}
{{ $paginator := .Paginate (where .Data.Pages "Type" "blog") }}
<div class="articles-list"> <div class="articles-list">
{{ range .Data.Pages }} {{ range $paginator.Pages }}
<article> <article>
<h3><a href="{{ .Permalink }}">{{ .Title }}</a> - {{ dateFormat "01-02-2006 15:04:05" .Date }}</h3> <h3><a href="{{ .Permalink }}">{{ .Title }}</a> - {{ dateFormat "01-02-2006 15:04:05" .Date }}</h3>
{{ .Summary }} {{ .Summary }}
</article> </article>
{{ end }} {{ end }}
</div> </div>
{{ template "_internal/pagination.html" . }}
{{ partial "bottom.html" . }} {{ partial "bottom.html" . }}

View File

@ -0,0 +1,18 @@
@import "./variables";
ul.pagination {
padding-left: 0px;
margin: 14px auto;
width: 200px;
text-align: center;
li {
display: inline-block;
padding: 3px;
&.active {
text-decoration: underline;
}
&.disabled a {
color: $text-color;
}
}
}

View File

@ -1,6 +1,7 @@
@import "./variables.scss"; @import "./variables";
@import "./custom-bootstrap.scss"; @import "./custom-bootstrap";
@import "./mixins.scss"; @import "./mixins";
@import "./paginator";
html { html {
height: 100%; height: 100%;