New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How about pagination #18
Comments
Hi, What you need to do is go to
should be changed to something like this.
Hope this works as I'm traveling and have not tried in my setting yet. Update 2018-07-12:
|
As I haven't heard from you, I will close this issue for now. Please reopen or ask further if you wish. |
Hi @htr3n, since version 2.0 this part has been rewrittent, as I'm new to hugo, I wonder
Ive tried many different thing but this usually ends in something like Do you have any clue or tips to make pagination work for posts page? |
Just in case I found a solution, maybe not the best, but it works : These files needs to be copied over the root of the Hugo site with the same relative path. And modify them as needed
--- 1/themes/hyde-hyde/layouts/partials/page-list/content.html
+++ 2/layouts/partials/page-list/content.html
@@ -1,6 +1,4 @@
<span class="section__title">{{ .Title }}</span>
<ul class="posts">
- {{ with .Data.Pages }}
- {{ partial "posts-list.html" . }}
- {{ end }}
-</ul>
+ {{ partial "posts-list.html" . }}
+</ul>
--- 1/themes/hyde-hyde/layouts/partials/posts-list.html
+++ 2/layouts/partials/posts-list.html
@@ -1,6 +1,7 @@
-{{ range . }}
+{{ $paginator := .Paginate (where .Pages "Type" "in" "posts") }}
+{{ template "_internal/pagination.html" . }}
+<br/>
+{{ range $paginator.Pages }}
<li>
<a href="{{ .RelPermalink }}" {{if .Draft}}class="draft"{{end}}>{{ .Title }}</a>
{{if not .Date.IsZero}}
<time class="pull-right hidden-tablet">{{ .Date.Format (.Site.Params.dateformat | default "Jan 02 '06") }}</time>
@@ -8,3 +9,4 @@
</span>
</li>
{{ end }}
+<br/>
+{{ template "_internal/pagination.html" . }} Here I’m using the Hugo internal template for pagination but one can image using a custom template. The |
How to set up pagination on this theme with Hugo
The text was updated successfully, but these errors were encountered: