0
votes

In Jekyll, I am currently able to list collections/posts on homepage but tags doesn't show.

For this job I tried to use semi-custom loop but it doesn't list tags like below sample code and expecting for show collections/posts with tags but it doesn't.

{% assign ordered_works = site.works | sort:"work-order" %}
{% for work in ordered_works reversed limit: 3 %}

<div class="scene">
  <div class="featured-works__item featured-works__item--blue tween-animation">
    <picture class="featured-works__item-thumb">
      <source 
        media="(min-width: 768px)" 
        srcset="/assets/images/works/{{ work.thumb-image }}.png 1x, /assets/images/works/{{ work.thumb-image }}@2x.png 2x"
      >
      <source 
        media="(max-width: 767px)" 
        srcset="/assets/images/works/{{ work.mobile-thumb-image }}.png 1x"
      >
      <img 
        src="/assets/images/works/{{ work.thumb-image }}.png" 
        alt="{% if work.cover-image-alt-text != "" %}{{work.cover-image-alt-text}}{% else %}{{ work.title}}{% endif %}"
      />
    </picture>
    <figure>
    </figure>
    <div class="featured-works__item-info" {% if work.bg-color %}style="background-color: {{ work.bg-color }}" {% endif %}>
      <h4>{{ work.title }}</h4>
      <h5>{{ work.sub-title }}</h5>
      <ul>
        {% for tag in page.tags %}
          <li>#{{ tag }}</li>
        {% endfor %}
      </ul>
      <p>{{ work.summary }}</p>
      <a href="{{ work.url }}" class="primary-button">Click Here to Detail</a>
    </div>
  </div>
</div>
{% endfor %}
1

1 Answers

1
votes

You can replace {% for tag in page.tags %} by {% for tag in work.tags %}.