diff options
author | ache <ache@ache.one> | 2023-07-05 07:54:04 +0200 |
---|---|---|
committer | ache <ache@ache.one> | 2023-07-05 07:54:04 +0200 |
commit | 2ea6f77f003176dcb01a5d6ffaedb48ae566d0fe (patch) | |
tree | ea6b04af49dfa8aaf770013fc02109cb883ecc6c /src | |
parent | Cohérence i18n (diff) |
🖼️ Fix image of RSS feed
Diffstat (limited to 'src')
-rw-r--r-- | src/build/rss.mjs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/build/rss.mjs b/src/build/rss.mjs index 4eec634..77837db 100644 --- a/src/build/rss.mjs +++ b/src/build/rss.mjs @@ -23,11 +23,13 @@ const getRSS = (articles, baseUrl, lang) => { }); for (const article of articles.slice(0, 10)) { + let image_url = (article.imageUrl[0] != '/') ? `/${article.imageUrl}` : article.imageUrl; + rssFeed.item({ title: article.title, description: '<article>' + article.content + '</article>', // eslint-disable-next-line camelcase - image_url: article.imageUrl, + image_url, url: `${baseUrl}articles/${article.name}`, guid: article.domTitle, author: 'ache', @@ -35,7 +37,7 @@ const getRSS = (articles, baseUrl, lang) => { categories: article.metaData.tags, // eslint-disable-next-line camelcase custom_elements: [ - {logo: article.imageUrl}, + {logo: image_url}, {intro: article.introDesc}, ], }); |