summaryrefslogtreecommitdiff
path: root/_includes/similar-posts.liquid
blob: 9a7e33a33c2cd7485d0b71dc505c93665e0c2420 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<aside class="menu">
    <p class="menu-label">
    Similar Posts 
    </p>

    <ul class="menu-list">
        {% for post in collections.posts.pages %}
            {% 
            if post.categories
            and page.categories
            and page.title != post.title
            and page.categories.first
            and post.categories contains page.categories.first 
            %}
            <li>
                <a href="/{{ post.permalink }}">
                    {% if post.published_date %}
                        <span class="tag is-rounded">
                            {{ post.published_date | date: "%e %b %Y" }}
                        </span>
                    {% endif %}

                    {{ post.title }}
                </a>
            </li>
        {% endif %}
    {% endfor %}
    </ul>
</aside>