From f4d8ac34dfa92ad13ede3768fb3b8dd1f1a1f423 Mon Sep 17 00:00:00 2001 From: kendo5731 Date: Thu, 4 Feb 2016 23:20:36 +0100 Subject: [PATCH] feat(): add support for pagination in _default/list.html --- README.md | 1 - layouts/_default/list.html | 4 +++- static/css/_paginator.scss | 18 ++++++++++++++++++ static/css/theme.scss | 7 ++++--- 4 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 static/css/_paginator.scss diff --git a/README.md b/README.md index beae103..18935a2 100644 --- a/README.md +++ b/README.md @@ -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 ! -- Support pagination in list layout - Support "dynamic" titles and descriptions - Uglify CSS and Javascript - Add integration with Disqus diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 2db2582..35372b8 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,10 +1,12 @@ {{ partial "top.html" . }} +{{ $paginator := .Paginate (where .Data.Pages "Type" "blog") }}
- {{ range .Data.Pages }} + {{ range $paginator.Pages }}

{{ .Title }} - {{ dateFormat "01-02-2006 15:04:05" .Date }}

{{ .Summary }}
{{ end }}
+{{ template "_internal/pagination.html" . }} {{ partial "bottom.html" . }} diff --git a/static/css/_paginator.scss b/static/css/_paginator.scss new file mode 100644 index 0000000..7288537 --- /dev/null +++ b/static/css/_paginator.scss @@ -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; + } + } +} \ No newline at end of file diff --git a/static/css/theme.scss b/static/css/theme.scss index 9c34a19..1dd6534 100644 --- a/static/css/theme.scss +++ b/static/css/theme.scss @@ -1,6 +1,7 @@ -@import "./variables.scss"; -@import "./custom-bootstrap.scss"; -@import "./mixins.scss"; +@import "./variables"; +@import "./custom-bootstrap"; +@import "./mixins"; +@import "./paginator"; html { height: 100%;