Permalink does not return the correct page

Why does Hugo show the home/section permalink instead of the paginated page e.g when I open page 3 in the canonical URL?

You are more likely to receive an accurate and timely response if you post a link to the public repository for your project.


Let us see your code

Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.

If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.

I added some clarification.

Not enough.

If I am on page 2, 3 etc, the canonical link remains like so in the HTML.

<link rel="canonical" href="" />

instead of

<link rel="canonical" href="" />

You are running into this:

This is a detailed description of the situation:

The trick is to paginate before trying to access the pager number.

The second topic includes a detailed example that you can clone and test.

I moved the $paginator code in your baseof.html to my head.html file. But testing so far and the links work.

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