fix: product hunt today (#6305)

This commit is contained in:
Ethan Shen
2020-12-01 11:45:35 +00:00
committed by GitHub
parent 1cb2d9af34
commit 6ce6d0c7c5
+2 -2
View File
@@ -11,11 +11,11 @@ module.exports = async (ctx) => {
title: 'Product Hunt Today Popular',
link: 'https://www.producthunt.com/',
item: list.map((l) => {
const img = `https://ph-files.imgix.net/${data[l.thumbnail.id].image_uuid}?auto=format&auto=compress&codec=mozjpeg&cs=strip&w=150&h=150&fit=crop`;
const img = l.thumbnail ? `https://ph-files.imgix.net/${data[l.thumbnail.id].image_uuid}?auto=format&auto=compress&codec=mozjpeg&cs=strip&w=150&h=150&fit=crop` : '';
return {
title: l.name,
description: `${l.tagline}<br><img src="${img}">`,
description: `${l.tagline}<br>${img === '' ? '' : `<img src="${img}">`}`,
link: 'https://www.producthunt.com/posts/' + l.slug,
pubDate: new Date(l.updated_at),
};