ethercreative / seo

SEO utilities including a unique field type, sitemap & redirect manager
MIT License
269 stars 96 forks source link

Canonical doesn't support {% paginate %} pages #335

Open MarkOlijslagers opened 3 years ago

MarkOlijslagers commented 3 years ago

Description

When using {% paginate %} the url's are appended with page numbers like /p1. The canonical tag of the paginated pages are all set without page number.

Additional info

thomEpps commented 1 year ago

@MarkOlijslagers did you ever find a solution to this? Im having the same issue with canonical URLs & pagination

MarkOlijslagers commented 1 year ago

@MarkOlijslagers did you ever find a solution to this? Im having the same issue with canonical URLs & pagination

@thomEpps , no we took this for granted. Hopefully this will be fixed in an upcoming release

therealpecus commented 1 year ago

It might be sufficient to change this line to

return UrlHelper::siteUrl(Craft::$app->request->getFullPath());

See: https://github.com/ethercreative/seo/blob/dc9fa7f47bb5e542afe2f7c7f8d09f047c55ce4c/src/models/data/SeoData.php#L381C41-L381C41

I am not aware of counter-issues, I'll open a PR to see if we can close this quickly.