-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgenerate-rss-feed.ts
More file actions
43 lines (40 loc) · 1.28 KB
/
generate-rss-feed.ts
File metadata and controls
43 lines (40 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import fs from "node:fs";
import { getSortedVersions } from "./app/changes/get-version.ts";
const sortedVersions = await getSortedVersions();
fs.writeFileSync(
"./public/feed.xml",
`<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Project+ releases</title>
<description>A feed of versions of Project+ including download links.</description>
<ttl>720</ttl>
<image>
<url>https://projectplusgame.com/favicon.ico</url>
<title>Project+ releases</title>
<link>https://projectplusgame.com</link>
<width>16</width>
<height>16</height>
</image>
<link>https://projectplusgame.com</link>
<atom:link href="https://projectplusgame.com/feed.xml" rel="self" type="application/rss+xml" />
<lastBuildDate>${new Date().toUTCString()}</lastBuildDate>
<language>en</language>
${sortedVersions
.toReversed()
.map(
(version) => `
<item>
<title>Project+ Download ${version}</title>
<guid isPermaLink="false">${version}</guid>
<link>https://projectplusgame.com/download</link>
<!-- <pubDate></pubDate> -->
<category>Release</category>
</item>
`,
)
.join("")}
</channel>
</rss>
`,
);