Connect Jekyll category list on homepage to category layout listing all posts in that category

My home.html layout has this code which lists the categories and links them to /category - which is what I want. But it links them to the “Index of /Category/”

{% for category in site.categories %}
      <h4><a class="" href="{{ category | first }}">{{ category[0] }}</a></h4>
{% endfor %}

I have a categories.html file in _layouts.I also have permalink: /:categories/:title/in my config file. How can I link to the layout that renders a category listing posts?