Vipps Donations #33
|
|
@ -25,3 +25,11 @@ Deno.test("generated rss contains all episode titles", () => {
|
||||||
assertEquals(feed.includes(episode.title), true);
|
assertEquals(feed.includes(episode.title), true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Deno.test("generated rss contains promo with link to donations page", () => {
|
||||||
|
const series = testUtils.generateSeries();
|
||||||
|
const feed = rss.assembleFeed(series);
|
||||||
|
|
||||||
|
console.log(feed);
|
||||||
|
feed.includes("Vurder å støtte utviklingen via Vipps med valgfritt beløp");
|
||||||
|
});
|
||||||
|
|
|
||||||
14
lib/rss.ts
14
lib/rss.ts
|
|
@ -57,8 +57,20 @@ function assembleFeed(series: Series): string {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function descriptionWithDonationPromotion(description: string): string {
|
||||||
|
const promotion =
|
||||||
|
`Takk for at du bruker NRSS 🙏🌟 Vurder å støtte utviklingen via Vipps med valgfritt beløp. Se mer på ${getHostUrl()}.`;
|
||||||
|
|
||||||
|
return `
|
||||||
|
--------------------------------\n
|
||||||
|
${promotion} \n
|
||||||
|
--------------------------------\n
|
||||||
|
${description}
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
function assembleEpisode(episode: Episode, seriesId: Series["id"]): Tag {
|
function assembleEpisode(episode: Episode, seriesId: Series["id"]): Tag {
|
||||||
const description = episode.subtitle || "";
|
const description = descriptionWithDonationPromotion(episode.subtitle || "");
|
||||||
|
|
||||||
return tag("item", [
|
return tag("item", [
|
||||||
tag("title", episode.title),
|
tag("title", episode.title),
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ export default function ({ data }: PageProps<Props>) {
|
||||||
)}
|
)}
|
||||||
{data.cancelled && (
|
{data.cancelled && (
|
||||||
<p>
|
<p>
|
||||||
Støtten er nå avsluttet. Tusen takk for at du har støttet NRSS!
|
Støtten er nå avsluttet. Tusen takk for at du har støttet NRSS 🙏🌟
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{!data.cancelled && (
|
{!data.cancelled && (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue