deno formatting
This commit is contained in:
parent
0ce01b97f1
commit
2109ae438f
|
|
@ -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",
|
||||
);
|
||||
});
|
||||
|
|
|
|||
25
lib/rss.ts
25
lib/rss.ts
|
|
@ -31,17 +31,15 @@ function assembleFeed(series: Series): string {
|
|||
tag("ttl", "60"), //60 minutes
|
||||
...(series.imageUrl
|
||||
? [
|
||||
tag("itunes:image", "", [["href", series.imageUrl]]),
|
||||
tag("image", [
|
||||
tag("url", series.imageUrl),
|
||||
tag("title", series.title),
|
||||
tag("link", series.link),
|
||||
]),
|
||||
]
|
||||
tag("itunes:image", "", [["href", series.imageUrl]]),
|
||||
tag("image", [
|
||||
tag("url", series.imageUrl),
|
||||
tag("title", series.title),
|
||||
tag("link", series.link),
|
||||
]),
|
||||
]
|
||||
: []),
|
||||
...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