feat: replace journal entry card with inline journal-post in dailies feed
This commit is contained in:
@@ -12,7 +12,6 @@
|
|||||||
{% for s in story_entries %}
|
{% for s in story_entries %}
|
||||||
{% set all_items = all_items|merge([{'type': 'story', 'page': s, 'date': s.date}]) %}
|
{% set all_items = all_items|merge([{'type': 'story', 'page': s, 'date': s.date}]) %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% set all_items = all_items|sort((a, b) => a.date < b.date ? 1 : -1) %}
|
|
||||||
|
|
||||||
{# Collect GPS entries for mini-map #}
|
{# Collect GPS entries for mini-map #}
|
||||||
{% set map_entries = [] %}
|
{% set map_entries = [] %}
|
||||||
@@ -119,45 +118,53 @@ feedMap.on('load', function () {
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if item.type == 'journal' %}
|
{% if item.type == 'journal' %}
|
||||||
<a class="entry-card" id="entry-{{ entry.slug }}" data-type="journal" 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-type="journal" 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>
|
||||||
|
<p class="journal-post-meta">
|
||||||
|
<a class="journal-post-permalink" href="{{ entry.url }}">
|
||||||
|
<time datetime="{{ entry.date|date('Y-m-d') }}">{{ entry.date|date('d M Y')|upper }}</time>
|
||||||
|
</a>
|
||||||
{% if entry.header.location_city or entry.header.location_country %}
|
{% if entry.header.location_city or entry.header.location_country %}
|
||||||
<span class="entry-location-overlay">
|
<span class="journal-post-location">
|
||||||
📍
|
· 📍
|
||||||
{% if entry.header.location_city %}{{ entry.header.location_city|slice(0,20) }}{% endif %}
|
|
||||||
{% 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 %}
|
|
||||||
<span class="entry-location-plain">
|
|
||||||
{%- 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>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% if images|length > 1 %}
|
||||||
|
<div class="journal-photo-dots" aria-hidden="true">
|
||||||
|
{% for img in images %}
|
||||||
|
<span class="journal-photo-dot{% if loop.first %} is-active{% endif %}"></span>
|
||||||
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="entry-card-body">
|
{% endif %}
|
||||||
<h2 class="entry-title">{{ entry.title }}</h2>
|
|
||||||
<p class="entry-excerpt">{{ entry.summary|striptags|slice(0, 250)|trim }}</p>
|
<div class="journal-post-body">{{ entry.content|raw }}</div>
|
||||||
<span class="entry-read-more">Read entry →</span>
|
</article>
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<a class="entry-card entry-card--story" id="entry-{{ entry.slug }}" data-type="story" href="{{ entry.url }}">
|
<a class="entry-card entry-card--story" id="entry-{{ entry.slug }}" data-type="story" href="{{ entry.url }}">
|
||||||
{% if hero %}
|
{% if hero %}
|
||||||
|
|||||||
Reference in New Issue
Block a user