fix: add eleventy:ignore to photo images and render photos in post template
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user