Skip to content

singular vs. plural taxonomies #30

Open
@ddierkes

Description

@ddierkes

I am puzzled by what 'page.category' would be in the post_macros template. This is the code in the repo.

{% if page.category %}
  <div class="post__category">
    <a href="{{ get_taxonomy_url(kind="category", name=page.category) }}">{{ page.category }}</a>
  </div>
{% endif %}

But I suspect that this is supposed to be displaying the categories taxonomy outlined elsewhere in the theme and should in fact be more like this, no?

{% if page.taxonomies.categories %}
   <div class="post__category">
      {% for category in page.taxonomies.categories %}
         <a href="{{ get_taxonomy_url(kind="categories", name=category) }}">{{ category }}</a>
       {% endfor %}
  </div>
{% endif %}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions