Skip to content

Commit

Permalink
New paginator syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Jan 25, 2015
1 parent 12a68d7 commit b12ff30
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
10 changes: 5 additions & 5 deletions layouts/_default/list.ace
Expand Up @@ -2,18 +2,18 @@
html xmlns=http://www.w3.org/1999/xhtml xml:lang=nn lang=nn
head
= include partials/head.html .
{{ if .Data.Paginator.HasNext }}
link rel="next" href="{{ .Site.BaseUrl }}{{ .Data.Paginator.Next.Url }}"
{{ if .Paginator.HasNext }}
link rel="next" href="{{ .Site.BaseUrl }}{{ .Paginator.Next.Url }}"
{{ end }}
{{ if .Data.Paginator.HasPrev }}
link rel="prev" href="{{ .Site.BaseUrl }}{{ .Data.Paginator.Prev.Url }}"
{{ if .Paginator.HasPrev }}
link rel="prev" href="{{ .Site.BaseUrl }}{{ .Paginator.Prev.Url }}"
{{ end }}
body.layout-reverse
= include partials/menu.html .
.content.container
.main.list
h1.post-title {{ .Title }}
{{ range .Data.Paginator.Pages }}
{{ range .Paginator.Pages }}
p
a href={{.Permalink}} {{.LinkTitle}}
span.bs-date  – {{.Date.Format "Jan 02, 2006"}}
Expand Down
7 changes: 5 additions & 2 deletions layouts/index.ace
Expand Up @@ -18,10 +18,13 @@ html xmlns=http://www.w3.org/1999/xhtml xml:lang=nn lang=nn
.front-read-more
h1 Sjå òg
ul
{{ range .Site.Taxonomies.tags.asterisk }}
{{ $indexNode := . }}
{{ range (.Paginate (where .Data.Pages "Type" "post")).Pages }}
{{/* range .Paginator.Pages */}}
li
a href={{ .Page.RelPermalink }} {{ .Page.Title }} <small>(ca. {{ .Page.FuzzyWordCount }} ord)</small>
a href={{ .RelPermalink }} {{ .Title }} <small>(ca. {{ .FuzzyWordCount }} ord)</small>
{{ end }}
= include partials/pagination.html .
= include partials/hello-simple.html .
= include partials/footer.html .

2 changes: 1 addition & 1 deletion layouts/partials/pagination.html
@@ -1,4 +1,4 @@
{{ $pag := .Data.Paginator }}
{{ $pag := .Paginator }}
{{ if gt $pag.TotalPages 1 }}
<nav class="pagination">
<ul class="pagination">
Expand Down

0 comments on commit b12ff30

Please sign in to comment.