Properly detect local page preview images

Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
Alexander Borsuk 2022-12-24 14:31:23 +01:00
parent c81436edc4
commit cd90d97c42

View file

@ -25,7 +25,7 @@
{%- set preview_image = resource.extra.preview_image -%}
{%- elif resource.assets %}
{%- set basename = resource.assets[0] | split(pat='/') | last %}
{%- if basename is ending_with('.jpg') %}
{%- if basename is ending_with('.jpg') or basename is ending_with('.jpeg') or basename is ending_with('.png') %}
{%- set preview_image = resource.path ~ basename -%}
{%- endif %}
{%- endif %}