| layout | page |
|---|---|
| permalink | /gallery/ |
| gallery_mode | square |
{% assign sorted_gallery = site.data.gallery | sort: "year" | reverse %} {% assign mode = page.gallery_mode | default: "masonry" %}
{% if mode == "square" %}
{% for item in sorted_gallery %}
{% else %}
<!-- Square gallery card -->
<div class="gallery-card gallery-card-square">
<div style="position: relative; width: 100%; padding-top: 100%; overflow: hidden;">
<!-- Image fills the square and is cropped with object-fit -->
<img class="gallery-bg" src="{{ item.file }}" alt="{{ item.highlight }}" style="position:absolute; top:0; left:0; width:100%; height:100%; object-fit:cover;">
<!-- Overlay with highlight text only -->
<div class="gallery-overlay">
<div class="gallery-highlight">{{ item.highlight }}</div>
</div>
</div>
</div>
</div>
{% endfor %}
{% for item in sorted_gallery %}
{% endif %}
<!-- Gallery card -->
<div class="gallery-card">
<!-- Image keeps original aspect ratio -->
<img class="gallery-bg" src="{{ item.file }}" alt="{{ item.highlight }}">
<!-- Overlay with highlight text only -->
<div class="gallery-overlay">
<div class="gallery-highlight">{{ item.highlight }}</div>
</div>
</div>
</div>
{% endfor %}