Parameter For Prev Next Paginator

On single page (single.html), I use {{ .PrevPage.Permalink }} and {{ .NextPage.Permalink }} to get prev and next page link. And it works like I expected.

On paginator page (list.html), I use {{ .Paginator.Prev.URL }} and {{ .Paginator.Next.URL }} but the result is only get path like this -> /blog/, /blog/2/, /blog/3/, etc.

How to get complete paginator link? So, the result is complete with https://example.com/blog/, https://example.com/blog/2/, https://example.com/3/, etc?

template

{{- $u := "/blog/2/" -}}
{{- absURL $u -}}

result

http://localhost:1313/blog/2/

1 Like

It works.

I changed from this ->

{{ .Site.BaseURL }}{{ .Paginator.Prev.URL }}
{{ .Site.BaseURL }}{{ .Paginator.Next.URL }}

To this ->

{{ .Paginator.Prev.URL | absURL }}
{{ .Paginator.Next.URL | absURL }}

Thanks.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.