summaryrefslogtreecommitdiffstats
path: root/src/server/template/sitemap.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/template/sitemap.ts')
-rw-r--r--src/server/template/sitemap.ts31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/server/template/sitemap.ts b/src/server/template/sitemap.ts
new file mode 100644
index 0000000..0a59ec5
--- /dev/null
+++ b/src/server/template/sitemap.ts
@@ -0,0 +1,31 @@
+import type { element } from "./vdom.js";
+import t, { Attribute } from "./xml.js";
+
+export function urlset(attr: Attribute, ...content: element<'url'>[]) {
+ return t("urlset", attr, ...content);
+}
+
+export function url(
+ attr: Attribute,
+ ...content: element<"loc" | "lastmod" | "changefreq" | "priority">[]
+) {
+ return t("url", attr, ...content);
+}
+
+export function loc(attr: Attribute, ...content: string[]) {
+ return t("loc", attr, ...content);
+}
+
+export function lastmod(attr: Attribute, content: string) {
+ return t("lastmod", attr, content);
+}
+
+export function changefreq(attr: Attribute,
+ content: "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never"
+) {
+ return t("changefreq", attr, content);
+}
+
+export function priority(attr: Attribute, content: string) {
+ return t("priority", attr, content);
+} \ No newline at end of file