feat: replace journal entry card with inline journal-post on home page

This commit is contained in:
2026-06-20 13:34:22 +00:00
parent 6283c840ff
commit 850d2f5c50
+40 -32
View File
@@ -59,45 +59,53 @@
{% endif %} {% endif %}
{% if item.type == 'journal' %} {% if item.type == 'journal' %}
<a class="entry-card" id="entry-{{ entry.slug }}" data-lat="{{ entry.header.lat }}" data-lng="{{ entry.header.lng }}" href="{{ entry.url }}"> {% set weather_icons = {
{% if hero %} 'Sunny': '☀️', 'Partly cloudy': '⛅', 'Cloudy': '☁️',
<div class="entry-card-photo"> 'Foggy': '🌫️', 'Drizzle': '🌦️', 'Rain': '🌧️',
<img src="{{ hero.cropResize(720, 405).url }}" alt="{{ entry.title }}" loading="lazy"> 'Snow': '❄️', 'Thunderstorm': '⛈️'
<div class="entry-card-photo-overlay"> } %}
<time class="entry-date-overlay" datetime="{{ entry.date|date('Y-m-d') }}"> <article class="journal-post" id="entry-{{ entry.slug }}" data-lat="{{ entry.header.lat }}" data-lng="{{ entry.header.lng }}">
{{ entry.date|date('d M Y')|upper }} <header class="journal-post-header">
</time> <h2 class="journal-post-title">{{ entry.title }}</h2>
{% if entry.header.location_city or entry.header.location_country %} <p class="journal-post-meta">
<span class="entry-location-overlay"> <a class="journal-post-permalink" href="{{ entry.url }}">
📍 <time datetime="{{ entry.date|date('Y-m-d') }}">{{ entry.date|date('d M Y')|upper }}</time>
{% if entry.header.location_city %}{{ entry.header.location_city|slice(0,20) }}{% endif %} </a>
{% if entry.header.location_city and entry.header.location_country %}, {% endif %}
{% if entry.header.location_country %}{{ entry.header.location_country }}{% endif %}
</span>
{% endif %}
</div>
</div>
{% else %}
<div class="entry-card-textmeta">
<time class="entry-date-plain" datetime="{{ entry.date|date('Y-m-d') }}">
{{ entry.date|date('d M Y')|upper }}
</time>
{% if entry.header.location_city or entry.header.location_country %} {% if entry.header.location_city or entry.header.location_country %}
<span class="entry-location-plain"> <span class="journal-post-location">
· 📍
{%- set _loc = [] -%} {%- set _loc = [] -%}
{%- if entry.header.location_city -%}{%- set _loc = _loc|merge([entry.header.location_city]) -%}{%- endif -%} {%- if entry.header.location_city -%}{%- set _loc = _loc|merge([entry.header.location_city]) -%}{%- endif -%}
{%- if entry.header.location_country -%}{%- set _loc = _loc|merge([entry.header.location_country]) -%}{%- endif -%} {%- if entry.header.location_country -%}{%- set _loc = _loc|merge([entry.header.location_country]) -%}{%- endif -%}
📍 {{ _loc|join(', ') }} {{ _loc|join(', ') }}
</span> </span>
{% endif %} {% endif %}
{% if entry.header.weather_desc %}
<span class="journal-post-weather">· {{ weather_icons[entry.header.weather_desc] ?? '' }} {{ entry.header.weather_desc }}</span>
{% endif %}
</p>
</header>
{% set images = entry.media.images %}
{% if images|length > 0 %}
<div class="journal-photo-strip" data-slides="{{ images|length }}">
{% for img in images %}
<div class="journal-photo-slide">
<img src="{{ img.cropResize(900, 600).url }}" alt="{{ entry.title }}" loading="lazy">
</div> </div>
{% endif %} {% endfor %}
<div class="entry-card-body"> </div>
<h2 class="entry-title">{{ entry.title }}</h2> {% if images|length > 1 %}
<p class="entry-excerpt">{{ entry.summary|striptags|slice(0, 250)|trim }}</p> <div class="journal-photo-dots" aria-hidden="true">
<span class="entry-read-more">Read entry →</span> {% for img in images %}
</div> <span class="journal-photo-dot{% if loop.first %} is-active{% endif %}"></span>
</a> {% endfor %}
</div>
{% endif %}
{% endif %}
<div class="journal-post-body">{{ entry.content|raw }}</div>
</article>
{% else %} {% else %}
<a class="entry-card entry-card--story" id="entry-{{ entry.slug }}" href="{{ entry.url }}"> <a class="entry-card entry-card--story" id="entry-{{ entry.slug }}" href="{{ entry.url }}">
{% if hero %} {% if hero %}