diff --git a/feed-json.njk b/feed-json.njk
index 9f42697..352e13a 100644
--- a/feed-json.njk
+++ b/feed-json.njk
@@ -18,14 +18,23 @@ eleventyExcludeFromCollections: true
"items": [
{%- for post in collections.feed %}
{%- set absolutePostUrl = site.url + post.url %}
- {%- set postImage = post.data.photo or post.data.image or (post.content | extractFirstImage) %}
+ {%- set postImage = post.data.photo %}
+ {%- if postImage %}
+ {# If photo is an array, use first element (check if first element looks like a URL) #}
+ {%- if postImage[0] and (postImage[0] | length) > 10 %}
+ {%- set postImage = postImage[0] %}
+ {%- endif %}
+ {%- endif %}
+ {%- if not postImage or postImage == "" %}
+ {%- set postImage = post.data.image or (post.content | extractFirstImage) %}
+ {%- endif %}
{
"id": "{{ absolutePostUrl }}",
"url": "{{ absolutePostUrl }}",
"title": {{ post.data.title | default(post.content | striptags | truncate(80)) | jsonEncode | safe }},
"content_html": {{ post.content | htmlToAbsoluteUrls(absolutePostUrl) | jsonEncode | safe }},
"date_published": "{{ post.date | dateToRfc3339 }}"
- {%- if postImage and postImage != "" %},
+ {%- if postImage and postImage != "" and (postImage | length) > 10 %},
"image": "{{ postImage | url | absoluteUrl(site.url) }}"
{%- endif %}
}{% if not loop.last %},{% endif %}
diff --git a/feed.njk b/feed.njk
index e867fef..5a65275 100644
--- a/feed.njk
+++ b/feed.njk
@@ -13,14 +13,23 @@ eleventyExcludeFromCollections: true
{{ collections.feed | getNewestCollectionItemDate | dateToRfc822 }}
{%- for post in collections.feed %}
{%- set absolutePostUrl = site.url + post.url %}
- {%- set postImage = post.data.photo or post.data.image or (post.content | extractFirstImage) %}
+ {%- set postImage = post.data.photo %}
+ {%- if postImage %}
+ {# If photo is an array, use first element (check if first element looks like a URL) #}
+ {%- if postImage[0] and (postImage[0] | length) > 10 %}
+ {%- set postImage = postImage[0] %}
+ {%- endif %}
+ {%- endif %}
+ {%- if not postImage or postImage == "" %}
+ {%- set postImage = post.data.image or (post.content | extractFirstImage) %}
+ {%- endif %}
-
{{ post.data.title | default(post.content | striptags | truncate(80)) | escape }}
{{ absolutePostUrl }}
{{ absolutePostUrl }}
{{ post.date | dateToRfc822 }}
{{ post.content | htmlToAbsoluteUrls(absolutePostUrl) | escape }}
- {%- if postImage and postImage != "" %}
+ {%- if postImage and postImage != "" and (postImage | length) > 10 %}
{%- set imageUrl = postImage | url | absoluteUrl(site.url) %}