Blog post category URLs are malformed

Every post has https://domain.com/categorieskittens instead of https://domain.com/categories/kittens

This, of course, leads to a 404 page.

This is only happening in the the bottom of every post, and not on the sidebar, so I’m leaning towards something in the theme’s footer. Perhaps some knows where’s the missing/un-escaped slash please?

<ul class="stats">
    {{ if isset .Params "categories" }}
        {{ $categoryCount := (len .Params.categories) }}

        <!--
            Set the title before displaying the categories associated with this post.
            The title will use the variables from the Categories menu set in the Config.
            If the Categories menu was not set then use the default values instead.
        -->
        {{ if ge $categoryCount 1 }}
            <li>
                {{ $categoryMenu := (where .Site.Menus.main "Name" "Categories") }}
                {{ if ne (len $categoryMenu) 0 }}
                    {{ $categoryMenu := index $categoryMenu 0 }}

                    {{ $.Scratch.Set "categoryUrl" $categoryMenu.URL }}

                    {{ with $categoryMenu.Identifier }}
                        <i class="{{ . }}">&nbsp;</i>
                    {{ end }}

                    {{ if gt $categoryCount 1 }}
                        {{ $categoryMenu.Name }}
                    {{ else }}
                        {{ $categoryMenu.Name | singularize }}
                    {{ end }}
                {{ else }}
                    {{ $.Scratch.Set "categoryUrl" "/categories/" }}

                    {{ if gt $categoryCount 1 }}
                        Categories
                    {{ else }}
                        Category
                    {{ end }}
                {{ end }}
            </li>
        {{ end }}
    {{ end }}

    <!-- Display the categories associated with this post -->
    {{ range .Params.categories }}
        <li><a href='{{ add ($.Scratch.Get "categoryUrl") . | urlize }}'>{{ . }}</a></li>
    {{ end }}
</ul>

You should post an issue to the theme author’s site.