How could I refactor this code so that the categories are separated by commas?
{{ $categories := .Params.categories }}
{{ $all_categories := .Site.Taxonomies.categories }}
{{ with $categories }}
<span class="post-categories">Categories:
{{- range $all_categories -}}
{{ if in $categories .Page.Title }}
<a href="{{- .Page.Permalink -}}">{{ .Page.Title }}</a> 
{{ end }}
{{- end }}
</span>
{{ end }}
I am a “beginner” at Hugo.