Show the last 6 publications on the homepage

This commit is contained in:
davegson 2021-03-25 18:19:30 +01:00
parent 2243da0537
commit 9cae6702c9

View file

@ -103,22 +103,19 @@ title: Safing - Love Freedom
</div>
<div class="mt-8 lg:mt-32">
<ul class="md:grid md:grid-cols-2 lg:grid-cols-3 md:col-gap-8 md:row-gap-10 max-w-sm mx-auto md:max-w-full">
<!-- podcast -->
{% assign sorted_podcasts = site.medias | reverse | where:"category","podcast" %}
{% for episode in sorted_podcasts limit: 1 %}
{% include thumbnail_podcast.html pre_header="PODCAST" %}
{% endfor %}
{% assign all_publications = site.medias | sort: "date" | reverse %}
<!-- video -->
{% assign sorted_videos = site.medias | reverse | where:"category","video" %}
{% for video in sorted_videos limit: 1 %}
{% include thumbnail_video.html pre_header="VIDEO" %}
{% endfor %}
<!-- blog -->
{% assign sorted_blogs = site.medias | reverse | where:"category","blog" %}
{% for post in sorted_blogs limit: 1 %}
{% include thumbnail_blog.html pre_header="BLOG" %}
{% for publication in all_publications limit: 6 %}
{% if publication.category == "blog" %}
{% assign post = publication %}
{% include thumbnail_blog.html pre_header="BLOG" %}
{% elsif publication.category == "video" %}
{% assign video = publication %}
{% include thumbnail_video.html pre_header="VIDEO" %}
{% elsif publication.category == "podcast" %}
{% assign episode = publication %}
{% include thumbnail_podcast.html pre_header="PODCAST" %}
{% endif %}
{% endfor %}
</ul>
<div class="pt-20 flex w-full">