fix: add eleventy:ignore to photo images and render photos in post template

This commit is contained in:
Ricardo
2026-01-28 22:25:48 +01:00
parent f9af152efd
commit 13f8876298
2 changed files with 15 additions and 5 deletions

View File

@@ -17,19 +17,16 @@ permalink: /photos/
{{ post.date | dateDisplay }}
</time>
</div>
{# Render photo(s) from frontmatter #}
{# Render photo(s) from frontmatter - use eleventy:ignore to skip image transform #}
{% if post.data.photo %}
<pre style="display:none" class="debug-photo">{{ post.data.photo | dump | safe }}</pre>
<div class="photo-gallery">
{% for img in post.data.photo %}
<pre style="display:none" class="debug-url">RAW:{{ img.url }}:END</pre>
{% set photoUrl = img.url %}
{% if photoUrl and photoUrl[0] != '/' and 'http' not in photoUrl %}
{% set photoUrl = '/' + photoUrl %}
{% endif %}
<pre style="display:none" class="debug-final">FINAL:{{ photoUrl }}:END</pre>
<a href="{{ post.url }}" class="photo-link">
<img src="{{ photoUrl }}" alt="{{ img.alt | default('Photo') }}" class="u-photo" loading="lazy">
<img src="{{ photoUrl }}" alt="{{ img.alt | default('Photo') }}" class="u-photo" loading="lazy" eleventy:ignore>
</a>
{% endfor %}
</div>