iakovos-generatefeedhtml.web.val.run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
export const generateFeedHTML = (feed) => {
return `
<table width="100%" border="0" cellspacing="0" cellpadding="0" role="presentation" style="margin-bottom:24px;">
<tr>
<td style="padding: 0; vertical-align:top;">
<div class="image-container">
${
feed.image ? `<img src="${feed.image}" alt="Feed Image">` : ""
}
</div>
</td>
<td style="padding-left:1.2rem; vertical-align:top;">
<h2 class="article-header" style="margin-top:0; margin-bottom:4px; font-size:1rem; color:#333; width:70%; line-height:1.2;">
<a class="article-link" href="${feed.link}" style="text-decoration:none; color:#333;">${feed.title}</a>
</h2>
<div style="font-size:0.9em; color:#999;">
<a href="${feed.website}" style="color:#999; text-decoration:none;">${feed.website}</a>
</div>
<p class="description" style="margin-top:4px; color:#999;">${feed.description}</p>
</td>
</tr>
</table>
`;
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023