Commit a216a3ad authored by j12t's avatar j12t

Hacking hugo pagination

parent 5adb400e
Pipeline #82223422 passed with stages
in 32 seconds
......@@ -9,9 +9,12 @@
{{ .Content }}
</article>
{{ $paginator := .Paginate ( where .Pages "Params.layout" "overview" ) }}
{{ template "_internal/pagination.html" . }}
<div class="systems-list">
<dl>
{{ range .Paginator.Pages }}
{{ range $paginator.Pages }}
<dt class="system-title">
<a href="{{ .Permalink }}">{{ .Title }}</a>
{{ if .Params.status }}
......@@ -24,14 +27,14 @@
{{ end }}
</dl>
</div>
{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }}
{{ if or ($paginator.HasPrev) (.Paginator.HasNext) }}
<ul class="pager main-pager">
{{ if .Paginator.HasPrev }}
{{ if $paginator.HasPrev }}
<li class="previous">
<a href="{{ .Permalink }}page/{{ .Paginator.Prev.PageNumber }}">&larr; {{ i18n "newerPosts" }}</a>
</li>
{{ end }}
{{ if .Paginator.HasNext }}
{{ if $paginator.HasNext }}
<li class="next">
<a href="{{ .Permalink }}page/{{ .Paginator.Next.PageNumber }}">{{ i18n "olderPosts" }} &rarr;</a>
</li>
......
{{ define "main" }}
<main class="miniresp-main">
<h1 class="title">{{ .Title }}</h1>
{{ if .Params.subtitle }}
<h2 class="subtitle">{{ .Params.subtitle }}</h2>
{{ end }}
<p>Layout systems/systemslist.html (sorry for the debug code)</p>
<article role="main" class="blog-post">
{{ .Content }}
</article>
<div class="systems-list">
<dl>
{{ range .Paginator.Pages }}
<dt class="system-title">
<a href="{{ .Permalink }}">{{ .Title }}</a>
{{ if .Params.status }}
<span class="page-status">{{ .Params.status }}</span>
{{ end }}
</dt>
{{ if .Params.description }}
<dd class="system-entry">{{ .Params.description }}</dd>
{{ end }}
{{ end }}
</dl>
</div>
{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }}
<ul class="pager main-pager">
{{ if .Paginator.HasPrev }}
<li class="previous">
<a href="{{ .Permalink }}page/{{ .Paginator.Prev.PageNumber }}">&larr; {{ i18n "newerPosts" }}</a>
</li>
{{ end }}
{{ if .Paginator.HasNext }}
<li class="next">
<a href="{{ .Permalink }}page/{{ .Paginator.Next.PageNumber }}">{{ i18n "olderPosts" }} &rarr;</a>
</li>
{{ end }}
</ul>
{{ end }}
</main>
{{ end }}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment