Add a second promo text to the front. #40
|
|
@ -38,12 +38,12 @@ Deno.test("generated rss contains promo with link to donations page", () => {
|
|||
const feed = rss.assembleFeed(series);
|
||||
|
||||
const indexOfFirstPromotion = feed.indexOf(
|
||||
"NRSS er avhengig av din Vipps-støtte"
|
||||
"NRSS er avhengig av din Vipps-støtte",
|
||||
);
|
||||
const indexOfSecondPromotion = feed.indexOf("Vurder å støtte utviklingen");
|
||||
assertLess(
|
||||
indexOfFirstPromotion,
|
||||
indexOfSecondPromotion,
|
||||
"First promotion should come before the second"
|
||||
"First promotion should come before the second",
|
||||
);
|
||||
});
|
||||
|
|
|
|||
11
lib/rss.ts
11
lib/rss.ts
|
|
@ -39,9 +39,7 @@ function assembleFeed(series: Series): string {
|
|||
]),
|
||||
]
|
||||
: []),
|
||||
...series.episodes.map((episode) =>
|
||||
assembleEpisode(episode, series.id)
|
||||
),
|
||||
...series.episodes.map((episode) => assembleEpisode(episode, series.id)),
|
||||
]),
|
||||
],
|
||||
[
|
||||
|
|
@ -49,14 +47,15 @@ function assembleFeed(series: Series): string {
|
|||
["xmlns:itunes", "http://www.itunes.com/dtds/podcast-1.0.dtd"],
|
||||
["xmlns:content", "http://purl.org/rss/1.0/modules/content/"],
|
||||
["xmlns:podcast", "https://podcastindex.org/namespace/1.0"],
|
||||
]
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
function descriptionWithDonationPromotion(description: string): string {
|
||||
const firstPromotion = `⬇️NRSS er avhengig av din Vipps-støtte⬇️`;
|
||||
const secondPromotion = `Takk for at du bruker NRSS 🙏🌟 Vurder å støtte utviklingen via Vipps med omtrent det samme som prisen på en kaffekopp. Se mer på https://nrss.deno.dev/`;
|
||||
const secondPromotion =
|
||||
`Takk for at du bruker NRSS 🙏🌟 Vurder å støtte utviklingen via Vipps med omtrent det samme som prisen på en kaffekopp. Se mer på https://nrss.deno.dev/`;
|
||||
|
||||
return `${firstPromotion}\n\n${description}\n\n${secondPromotion}`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue