madrilene / eleventy-excellent

Eleventy starter based on the workflow suggested by Andy Bell's buildexcellentwebsit.es.
https://eleventy-excellent.netlify.app/
Other
382 stars 69 forks source link

Post Tags on Blog Cards #40

Closed flamedfury closed 6 months ago

flamedfury commented 6 months ago

Hey again :wave:

Throwing it out there if you might know why the blog cards is just rendering posts as the tag rather than the tags defined in each posts front matter?

Have I configured something somewhere to cause this?

See post grid on main page and the posts page

madrilene commented 6 months ago

Hi! This code sets to only show the second item in the array, as the first is always "posts".

    if
          activateTags and item.data.tags.length > 1
        %}
          <span class="button post-tag"> {{ item.data.tags[1] }} </span>
        {% endif %}

For some reason, you get posts twice:

image

in posts.json you can remove "tags": "posts", and it should work again.

{ "layout": "post", "permalink": "/blog/{{ title | slugify }}/index.html" }

Will look into making this more reliable.

flamedfury commented 6 months ago

Thank you 🎉