Docs + fixes

This commit is contained in:
welpo 2026-01-13 22:43:04 +01:00
parent c1840dfd36
commit 48afab90e3
No known key found for this signature in database
GPG key ID: A2F978CF4EC1F5A6
5 changed files with 31 additions and 11 deletions

View file

@ -97,7 +97,12 @@
{% if post.extra.local_image or post.extra.remote_image %}
<li class="post-thumbnail">
<a href="{{ post.permalink }}">
{% if post.extra.local_image_dark and not post.extra.local_image %}
{{ throw(message="ERROR: `local_image_dark` requires `local_image` to be set in " ~ post.path) }}
{% endif %}
{% if post.extra.remote_image_dark and not post.extra.remote_image %}
{{ throw(message="ERROR: `remote_image_dark` requires `remote_image` to be set in " ~ post.path) }}
{% endif %}
{% if post.extra.local_image %}
{% if post.extra.local_image_dark %}
{# Show light image only in light mode, dark image only in dark mode #}
@ -109,7 +114,7 @@
{% if meta_dark.height %}height="{{ meta_dark.height }}"{% endif %}>
{% endif %}
{% set meta = get_image_metadata(path=post.extra.local_image, allow_missing=true) %}
<img class="thumbnail-image{% if page.extra.local_image_dark %} img-light{% endif %}"
<img class="thumbnail-image{% if post.extra.local_image_dark %} img-light{% endif %}"
alt="{{ post.extra.local_image }}"
src="{{ get_url(path=post.extra.local_image) }}"
{% if meta.width %}width="{{ meta.width }}"{% endif %}
@ -122,11 +127,13 @@
alt="{{ post.extra.remote_image_dark }}"
src="{{ get_url(path=post.extra.remote_image_dark) }}">
{% endif %}
<img class="thumbnail-image{% if page.extra.remote_image_dark %} img-light{% endif %}"
<img class="thumbnail-image{% if post.extra.remote_image_dark %} img-light{% endif %}"
alt="{{ post.extra.remote_image }}"
src="{{ post.extra.remote_image }}">
{% endif %}
{% endif %}
</a>
</li>
{% endif %}
{% if post.draft %}
<li class="draft-label">{{ macros_translate::translate(key="draft", default="DRAFT", language_strings=language_strings) }}</li>