From e49d6e4917ef6761f75447139bbd80a01be4f97d Mon Sep 17 00:00:00 2001 From: teddit Date: Fri, 1 Jan 2021 19:34:40 +0100 Subject: [PATCH] add enclosure element --- inc/teddit_api/handleSubreddit.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/inc/teddit_api/handleSubreddit.js b/inc/teddit_api/handleSubreddit.js index da97abb..a0245d1 100644 --- a/inc/teddit_api/handleSubreddit.js +++ b/inc/teddit_api/handleSubreddit.js @@ -50,6 +50,13 @@ module.exports = function() { if(is_self_link) link.url = link.permalink + + let thumb_mime = '' + let ext = thumbnail.split('.').pop() + if(ext === 'png') + thumb_mime = 'image/png' + else + thumb_mime = 'image/jpeg' let append_desc_html = `
[link] [comments]` @@ -61,6 +68,7 @@ module.exports = function() { ${link.domain} ${link.id} ${thumbnail} + ${link.permalink} ${link.url}