The default pagination in Hugo is just by pages, and write like this
{{ range (.Paginator 10) .Pages}} {{end}}
then we can use the button Paginator.prev and Paginator.next
what I want is just paginated from the varaible i use in my single toml.file,for example like
{{ range Paginator .Site.Params.cases}} {{end}}
How should I write my code?
You cannot use Hugo’s pagination feature on single pages. You can only paginate list pages. See doc: Pagination | Hugo
There are functions on the Page object that can be used to “fake” some form of pagination. Have a look at this:
.Next
, .NextInSection
, .Prev
, .PrevInSection
could be used for links between single posts. A numbered pagination however is not possible.
What is this? Is a case
related to a page? If so, how?
Ok,I use this function to try
Yes, the default Paginator can only produced by list of pages, I just want paginate with varaible in a single page