perf: skip hero media lookup for journal entries — only story cards use it

This commit is contained in:
2026-06-20 18:27:45 +02:00
parent 229532ab8b
commit 20212fee25
3 changed files with 18 additions and 18 deletions
@@ -112,12 +112,6 @@ feedMap.on('load', function () {
{% if all_items|length > 0 %} {% if all_items|length > 0 %}
{% for item in all_items %} {% for item in all_items %}
{% set entry = item.page %} {% set entry = item.page %}
{% set hero = null %}
{% if entry.header.hero_image and entry.media[entry.header.hero_image] is defined %}
{% set hero = entry.media[entry.header.hero_image] %}
{% elseif entry.media.images|length > 0 %}
{% set hero = entry.media.images|first %}
{% endif %}
{% if item.type == 'journal' %} {% if item.type == 'journal' %}
{% set weather_icons = { {% set weather_icons = {
@@ -168,6 +162,12 @@ feedMap.on('load', function () {
<div class="journal-post-body">{{ entry.content|raw }}</div> <div class="journal-post-body">{{ entry.content|raw }}</div>
</article> </article>
{% else %} {% else %}
{% set hero = null %}
{% if entry.header.hero_image and entry.media[entry.header.hero_image] is defined %}
{% set hero = entry.media[entry.header.hero_image] %}
{% elseif entry.media.images|length > 0 %}
{% set hero = entry.media.images|first %}
{% endif %}
<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 %}
<div class="entry-card-photo entry-card-photo--story"> <div class="entry-card-photo entry-card-photo--story">
+6 -6
View File
@@ -51,12 +51,6 @@
{% if all_items|length > 0 %} {% if all_items|length > 0 %}
{% for item in all_items %} {% for item in all_items %}
{% set entry = item.page %} {% set entry = item.page %}
{% set hero = null %}
{% if entry.header.hero_image and entry.media[entry.header.hero_image] is defined %}
{% set hero = entry.media[entry.header.hero_image] %}
{% elseif entry.media.images|length > 0 %}
{% set hero = entry.media.images|first %}
{% endif %}
{% if item.type == 'journal' %} {% if item.type == 'journal' %}
{% set weather_icons = { {% set weather_icons = {
@@ -107,6 +101,12 @@
<div class="journal-post-body">{{ entry.content|raw }}</div> <div class="journal-post-body">{{ entry.content|raw }}</div>
</article> </article>
{% else %} {% else %}
{% set hero = null %}
{% if entry.header.hero_image and entry.media[entry.header.hero_image] is defined %}
{% set hero = entry.media[entry.header.hero_image] %}
{% elseif entry.media.images|length > 0 %}
{% set hero = entry.media.images|first %}
{% endif %}
<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 %}
<div class="entry-card-photo entry-card-photo--story"> <div class="entry-card-photo entry-card-photo--story">
+6 -6
View File
@@ -214,12 +214,6 @@
{% if all_items|length > 0 %} {% if all_items|length > 0 %}
{% for item in all_items %} {% for item in all_items %}
{% set entry = item.page %} {% set entry = item.page %}
{% set hero = null %}
{% if entry.header.hero_image and entry.media[entry.header.hero_image] is defined %}
{% set hero = entry.media[entry.header.hero_image] %}
{% elseif entry.media.images|length > 0 %}
{% set hero = entry.media.images|first %}
{% endif %}
{% if item.type == 'journal' %} {% if item.type == 'journal' %}
{% set weather_icons = { {% set weather_icons = {
@@ -270,6 +264,12 @@
<div class="journal-post-body">{{ entry.content|raw }}</div> <div class="journal-post-body">{{ entry.content|raw }}</div>
</article> </article>
{% else %} {% else %}
{% set hero = null %}
{% if entry.header.hero_image and entry.media[entry.header.hero_image] is defined %}
{% set hero = entry.media[entry.header.hero_image] %}
{% elseif entry.media.images|length > 0 %}
{% set hero = entry.media.images|first %}
{% endif %}
<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 %}
<div class="entry-card-photo entry-card-photo--story"> <div class="entry-card-photo entry-card-photo--story">