feat: add option to invert images in project cards (#600)

This commit is contained in:
Óscar 2025-12-27 14:47:30 +01:00 committed by GitHub
parent 980e58e356
commit 6f687487df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 5 deletions

View file

@ -18,15 +18,16 @@
{% if page.taxonomies %}
data-tags="{% for tax_name, terms in page.taxonomies %}{% for term in terms | unique %}{{ term | lower }}{% if not loop.last %},{% endif %}{% endfor %}{% endfor %}"
{% endif %}>
{% if page.extra.invertible_image %}{% set card_image_class = "card-image invertible-image" %}{% else %}{% set card_image_class = "card-image" %}{% endif %}
{% if page.extra.local_image %}
{% set meta = get_image_metadata(path=page.extra.local_image, allow_missing=true) %}
<img class="card-image"
<img class="{{ card_image_class }}"
alt="{{ page.extra.local_image }}"
src="{{ get_url(path=page.extra.local_image) }}"
{% if meta.width %}width="{{ meta.width }}"{% endif %}
{% if meta.height %}height="{{ meta.height }}"{% endif %}>
{% elif page.extra.remote_image %}
<img class="card-image"
<img class="{{ card_image_class }}"
alt="{{ page.extra.remote_image }}"
src="{{ page.extra.remote_image }}">
{% else %}