I am creating an archive by date and using this solution.
I want to add the category of the post next to the post and am having trouble capturing the category name of a post since categories are indexed through the site
{% else %}
<li><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
{% capture category_names %}{{ ## need to capture category }}{% endcapture %}
{% if category_name %} - {% for category in category_names %}
<a href="{{site.baseurl}}/categories/#{{category|slugize}}">{{category}}</a>
{% unless forloop.last %} {% endunless %}
{% endfor %}
{% endif %}
{% if post.date %} - {{ post.date | date: "%m/%d/%Y" }}{% endif %}</li>
{% endif %}
Currently the code above creates {post name } - - mm/dd/YYYY as I want without the category name in between the 2 '-'.
Any idea how to capture the category name of a post? Thank you.