add basic feed layout

This commit is contained in:
yuki 2025-10-18 09:53:12 -03:00
parent 83c3063720
commit 1e4e55e134
Signed by: yuki
GPG key ID: 0C98E6FF04EC3915
2 changed files with 42 additions and 0 deletions

View file

@ -19,6 +19,11 @@ es = "música"
en = "etc"
es = "etc"
# blog
[read-more]
en = "read more..."
es = "leer más..."
# 404
[404]
en = "404 not found"

37
_layouts/recent_feed.njk Normal file
View file

@ -0,0 +1,37 @@
{#
possible variables:
- cycling_tag: collection tag to cycle through
- sidebar: .njk include file as sidebar [optional]
#}
{% extends "_layouts/base.njk" %}
{% block content %}
{% if sidebar %}
<div id="feed-sidebar">
{% include sidebar %}
</div>
{% endif %}
<div id="feed">
<div class="true-content">
{{ content | safe }}
</div>
{% for post in collections[cycling_tag] | i18n_filter %}
<div class="feed-item">
<h2>2025</h2>
<h3 id="{{ post.data.title | slugify }}" class="post-title">{{ post.data.title }}</h3>
<p class="post-date">{{ post.date | date("dd/MM/yyyy") }}</p>
{#<p>Debug: {{ post.date }} -> {{ post.date | date("dd/MM/yyyy") }}</p>#}
{% if post.data.description %}
<p class="post-description">{{ post.data.description }}</p>
{% else %}
<p class="post-excerpt">{% excerpt post %}</p>
{% endif %}
<a href="{{ post.url | locale_url_resolve }}" class="post-link">{{ "read-more" | i18n }}</a>
{% if post.data.image %}
<img src="{{ post.data.image }}" alt="{{ post.data.image.alt }}" class="post-image">
{% endif %}
</div>
{% endfor %}
</div>
{% endblock content %}