I use Str::slug($tag)
to have lowercase slugs for tags
<?php foreach ($tags as $tag): ?>
<li><a href="<?= url($page->parent(), ['params' => ['tag' => Str::slug($tag)]]) ?>"><?= $tag ?></a></li>
<?php endforeach ?>
But now on the parent page where posts are filtered by the clicked tag, the tag name is displayed as the slug. A tag named “Good Day” will now be shown as “good-day”
<?php if ($tag = param('tag')): ?>
<h1><?= $tag ?></h1>
<?php else: ?>
...