diff --git a/templates/base.html b/templates/base.html index 2c8309da..8b345ee3 100644 --- a/templates/base.html +++ b/templates/base.html @@ -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') or basename is ending_with('.jpeg') or basename is ending_with('.png') %} + {%- if basename is ending_with('.jpg') or basename is ending_with('.jpeg') or basename is ending_with('.png') or basename is ending_with('.webp') %} {%- set preview_image = resource.path ~ basename -%} {%- endif %} {%- endif %} diff --git a/update_news.js b/update_news.js index 79699efa..bc2785e0 100644 --- a/update_news.js +++ b/update_news.js @@ -140,6 +140,7 @@ function parseHtml(html) { if (!text && prevDate && (new Date(date) - new Date(prevDate)) <= kPostsDiffInMs) { // Do not download jpg if images already exist. if (!fs.existsSync(`${prevDir}/${i}.png`) + && !fs.existsSync(`${prevDir}/${i}.webp`) && !fs.existsSync(`${prevDir}/${i}.jpg`) && !fs.existsSync(`${prevDir}/${i}.jpeg`)) { downloads.push(downloadAsync(photo, `${prevDir}/${fileName}`));