Hi lovely Kirbyists, long time no see!
As Kirby uses its own formating of params, it makes it possible to do Rel Canonical just right by soft-whitelisting these.
So in your header.php template:
<?php if( count(url::params()) ): ?>
<link rel="canonical" href="<?= $page->url() . '/' . kirby()->request()->params() ?>">
<?php else: ?>
<link rel="canonical" href="<?= $page->url() ?>">
<?php endif; ?>
Thus preventing some pretty common mistakes (see mistake #1) descibed by Google here Official Google Webmaster Central Blog: 5 common mistakes with rel=canonical
yoursite.com/blog/page:2
with a rel canonical to yoursite.com/blog
is the most common mistake and prevents Google from indexing your entire pagination or simply decides to ignore rel canonical for your entire site.
Pretty handy if you have e.g. yoursite.com/blog/tag:cats
…I mean, who doesn’t want these indexed.
Please feel free to improve on it, if it can be prettier or have any feedback