feat: display photos on /photos/ listing page

- Render photo frontmatter as actual img tags
- Add photo gallery CSS with responsive grid
- Support multi-photo posts with 2-column grid
- Add photo caption styling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ricardo
2026-01-28 21:19:52 +01:00
parent b188edd2ee
commit 2581a6eaa5
2 changed files with 48 additions and 2 deletions

View File

@@ -9,7 +9,7 @@ permalink: /photos/
</div>
{% if collections.photos.length > 0 %}
<ul class="post-list">
<ul class="post-list photo-list">
{% for post in collections.photos %}
<li class="h-entry">
<div class="post-meta">
@@ -17,7 +17,19 @@ permalink: /photos/
{{ post.date | dateDisplay }}
</time>
</div>
<div class="e-content">{{ post.templateContent | safe }}</div>
{# Render photo(s) from frontmatter #}
{% if post.data.photo %}
<div class="photo-gallery">
{% for img in post.data.photo %}
<a href="{{ post.url }}" class="photo-link">
<img src="{{ img.url }}" alt="{{ img.alt | default('Photo') }}" class="u-photo" loading="lazy">
</a>
{% endfor %}
</div>
{% endif %}
{% if post.templateContent %}
<div class="e-content photo-caption">{{ post.templateContent | safe }}</div>
{% endif %}
</li>
{% endfor %}
</ul>