How do I list the recent postings by posting tag in Jekyll?

Viewed 190

On my Jekyll page, I have three different types of postings: game, biz, thoughts, with each posting type categorized by tags.

I use the code below for my index.html as it shows the most recent postings on my site by posting time, displaying each posting in the list with 'post.title', 'post.date', 'post.tags', 'page.summary(content)' information.

However, my site has different pages for different posting category(game, biz review, and thoughts), and I would like to use this display format which I used in index.html (the code below), on the front page of each different page (game, biz review, and thoughts).

<div class="home">

    <div class="post-list">
        {% for post in site.posts limit:10 %}


    <h2><a class="post-link" href="{{ post.url | remove: "/" }}">{{ post.title }}</a></h2>
        <span class="post-meta">{{ post.date | date: "%b %-d, %Y" }} /
            {% for tag in post.tags %}

                <a href="{{ "tag_" | append: tag | append: ".html"}}">{{tag}}</a>{% unless forloop.last %}, {% endunless%}

                {% endfor %}</span>
        <p>{% if page.summary %} {{ page.summary | strip_html | strip_newlines | truncate: 160 }} {% else %} {{ post.content | truncatewords: 50 | strip_html }} {% endif %}</p>

        {% endfor %}

    </div>
</div>

For more clear understanding, I included some pictures that may help understanding my question.

Much thanks to the community for help in advance!


index.html showing recent postings(of all kinds) from the sites

I want the below listing to show the recent postings only from the postings with game tags.

1 Answers
Related