Skip to content
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

all links in pagination marked as canonical except for next, prev #92

Open
StarWar opened this issue Oct 14, 2019 · 1 comment
Open
Labels

Comments

@StarWar
Copy link

StarWar commented Oct 14, 2019

The library marks all page links except for next & prev as canonical. Which I think is wrong? It should only set the current page as canonical and make it a disabled link. However, this lib makes the current link a simple li element but tags all other links as canonical.

Currently, it outputs the following links:-
I'm on the page 4. However, it doesn't mark page 4 as canonical. It marks page 1 and 2 as canonical and page 3 as prev.

<ul class="pagination">
<li class="waves-effect"><a class="" href="/categories/health?page=3" rel="prev"><i class="material-icons">chevron_left</i></a></li>
<li class="waves-effect"><a class="" href="/categories/health" rel="canonical">1</a></li>
<li class="waves-effect"><a class="" href="/categories/health?page=2" rel="canonical">2</a></li>
<li class="waves-effect"><a class="" href="/categories/health?page=3" rel="prev">3</a></li>
<li class="active"><a class="">4</a></li></ul>

The library should also provide a method so that we can add next, prev and canonical links in the head using rel links or provide a feature to disable canonical tag marking in pagination links. the next and prev are marked correctly. However, I think marking every other link as canonical in the pagination is wrong. Some SEO expert may explain or share more informed opinion regarding it. This is a nice library and I'm planning to use in my first elixir project. My opinion is based on how Kaminari (a ruby gem) works.

@mgwidmann
Copy link
Owner

If this is a bug as you describe, it should be reproducible in a unit test. As such, if you can open a PR I would be willing to accept it if it proved the existence of said bug.

@mgwidmann mgwidmann added the bug label Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants