fix: ensure photo URLs have leading slash

This commit is contained in:
Ricardo
2026-01-28 21:31:06 +01:00
parent 2581a6eaa5
commit faf881b93f
+2 -1
View File
@@ -21,8 +21,9 @@ permalink: /photos/
{% if post.data.photo %} {% if post.data.photo %}
<div class="photo-gallery"> <div class="photo-gallery">
{% for img in post.data.photo %} {% for img in post.data.photo %}
{% set photoUrl = img.url if img.url.startsWith('/') or img.url.startsWith('http') else '/' + img.url %}
<a href="{{ post.url }}" class="photo-link"> <a href="{{ post.url }}" class="photo-link">
<img src="{{ img.url }}" alt="{{ img.alt | default('Photo') }}" class="u-photo" loading="lazy"> <img src="{{ photoUrl }}" alt="{{ img.alt | default('Photo') }}" class="u-photo" loading="lazy">
</a> </a>
{% endfor %} {% endfor %}
</div> </div>