Single blog entry: How to display its tags?

In your template with the single blog entry:

<?php
  $tags = $article->tags()->split(); 
?>
<ul>
<?php foreach($tags as $tag): ?>
  <!-- change link to the page that lists all articles if necessary -->
  <li><a href="<?php echo url('blog/tag:' . urlencode($tag)) ?>"><?php echo $tag ?></a></li>
<?php endforeach ?>
</ul>

In the controller of the blog or home page where you list your articles, filter by tag if the tag parameter is called:

<?php
  return function($site, $pages, $page) {

    $tag = urldecode(param('tag'));
    if($tag) {
    	$articles = page('blog')->children()->visible()->filterBy('tags', $tag,',')->sortBy('date')->flip();
    } else {
    	$articles = page('blog')->children()->visible()->sortBy('date')->flip();
    }   
   
     return compact('articles');

};