diff --git a/src/routes/licenses/+page.svelte b/src/routes/licenses/+page.svelte
index c6715e8..2aac088 100644
--- a/src/routes/licenses/+page.svelte
+++ b/src/routes/licenses/+page.svelte
@@ -50,6 +50,14 @@
}
+
+ Strict POSIX cron: Licenses
+
+
+
Licenses
diff --git a/src/routes/robots.txt/+server.ts b/src/routes/robots.txt/+server.ts
new file mode 100644
index 0000000..8d82476
--- /dev/null
+++ b/src/routes/robots.txt/+server.ts
@@ -0,0 +1,19 @@
+import type { RequestHandler } from "@sveltejs/kit";
+
+export const GET: RequestHandler = async ({ url }) => {
+ const origin = url.origin;
+ const lines = [
+ "# allow crawling everything by default",
+ "User-agent: *",
+ "Disallow:",
+ "",
+ `Sitemap: ${origin}/sitemap.xml`
+ ];
+ const body = lines.join("\n") + "\n";
+ return new Response(body, {
+ headers: {
+ "Content-Type": "text/plain; charset=utf-8",
+ "Cache-Control": "public, max-age=86400"
+ }
+ });
+};
diff --git a/src/routes/sitemap.xml/+server.ts b/src/routes/sitemap.xml/+server.ts
new file mode 100644
index 0000000..e96cbf8
--- /dev/null
+++ b/src/routes/sitemap.xml/+server.ts
@@ -0,0 +1,49 @@
+import type { RequestHandler } from "@sveltejs/kit";
+
+// Compute a stable lastmod at module load (approximates deploy time)
+const BUILD_LASTMOD = new Date().toISOString();
+
+const pages = [
+ {
+ path: "/",
+ changefreq: "yearly",
+ priority: 1.0
+ },
+ {
+ path: "/licenses",
+ changefreq: "yearly",
+ priority: 0.6
+ }
+] as const;
+
+function xmlEscape(s: string): string {
+ return s
+ .replace(/&/g, "&")
+ .replace(//g, ">")
+ .replace(/"/g, """)
+ .replace(/'/g, "'");
+}
+
+export const GET: RequestHandler = async ({ url }) => {
+ const origin = url.origin;
+ const lastmod = BUILD_LASTMOD;
+ const body =
+ `\n` +
+ `` +
+ pages
+ .map((p) => {
+ const loc = xmlEscape(`${origin}${p.path}`);
+ return `\n \n ${loc}\n ${lastmod}\n ${p.changefreq}\n ${p.priority.toFixed(1)}\n `;
+ })
+ .join("") +
+ `\n\n`;
+
+ return new Response(body, {
+ headers: {
+ "Content-Type": "application/xml; charset=utf-8",
+ // Encourage caching for a day; adjust if content changes more frequently
+ "Cache-Control": "public, max-age=86400"
+ }
+ });
+};
diff --git a/static/robots.txt b/static/robots.txt
deleted file mode 100644
index b6dd667..0000000
--- a/static/robots.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-# allow crawling everything by default
-User-agent: *
-Disallow:
From f8470ddadd3016ffd8d5f7eb443415553648ecb2 Mon Sep 17 00:00:00 2001
From: Daschi <50054971+Daschi1@users.noreply.github.com>
Date: Sun, 31 Aug 2025 16:29:32 +0200
Subject: [PATCH 5/5] chore: bump version to 1.5.0
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 379190d..4f70932 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "cron-builder-parser",
"private": true,
- "version": "1.4.1",
+ "version": "1.5.0",
"description": "Strict POSIX cron: Builder & Parser",
"author": "Daschi (https://github.com/Daschi1)",
"repository": {