KhanovaSkola / khanovaskola-v3

https://khanovaskola.cz
MIT License
2 stars 3 forks source link

Use canonical URLs in sitemap #19

Closed danielhollas closed 2 years ago

danielhollas commented 4 years ago

Currently, Google ignores most of our sitemap because we do not provide canonical URLs for video pages.

We're using the Cartographer library inside a Sitemap.php presenter. Not sure how easy is to get canonical URLs from there.

If it's not easy, maybe we should just generate a static sitemap (and have a command to regenerate it when needed). Though that's a little dangerous.

danielhollas commented 4 years ago

Maybe hint here (though we probably cannot use this in the Sitemap context as it would redirect the Sitemap presenter) https://doc.nette.org/en/3.0/presenters#toc-canonization

Though maybe we should just use $this->link() instead of $this->absoluteLink()? https://doc.nette.org/en/3.0/presenters#toc-creating-links

danielhollas commented 4 years ago

Okay, so absoluteLink() is defined in app/Components/ControlTrait.php, and it seems we "just" need to pass in the Block and Schema objects as additional arguments.