From da156b535f2d624b928305dc14b8d13079a76c1e Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 14 Apr 2019 23:59:34 +0800 Subject: [PATCH 2/2] Introduce the pagination to the Labs's section list page: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` --- a/layouts/labs/list.html +++ b/layouts/labs/list.html @@ -6,14 +6,34 @@

{{ .Title }}

{{.Content}}
- {{ range .Data.Pages }} + {{ $paginator := .Paginate (where .Data.Pages "Type" "labs") }} + {{ range $paginator.Pages }}

{{ .Title }} {{ if .Draft }}:: DRAFT{{end}}

- {{ .Date.Format "Jan 2, 2006" }}: {{.Description}} + {{ .Date.Format "Jan 2, 2006" }}   + {{ range .Params.categories }} + #{{ . }}  + {{ end }} + {{ range .Params.tags }} + #{{ . }}  + {{ end }}: {{ .Description }}
{{ end }} + + + {{ partial "footer.html" . }} ``` --- layouts/labs/list.html | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/layouts/labs/list.html b/layouts/labs/list.html index b1bc8ec..c670405 100644 --- a/layouts/labs/list.html +++ b/layouts/labs/list.html @@ -6,14 +6,34 @@

{{ .Title }}

{{.Content}}
- {{ range .Data.Pages }} + {{ $paginator := .Paginate (where .Data.Pages "Type" "labs") }} + {{ range $paginator.Pages }}

{{ .Title }} {{ if .Draft }}:: DRAFT{{end}}

- {{ .Date.Format "Jan 2, 2006" }}: {{.Description}} + {{ .Date.Format "Jan 2, 2006" }}   + {{ range .Params.categories }} + #{{ . }}  + {{ end }} + {{ range .Params.tags }} + #{{ . }}  + {{ end }}: {{ .Description }}
{{ end }} + + + {{ partial "footer.html" . }}