← back to Ventura Claw
/sitemap.xml: per-URL <lastmod> (resolved from underlying HTML mtime when available, fallback to server start) + <priority> per route; SEO win after post-pivot copy sweep so Google recrawls
7489430a08643b3def404f3d9040db4789f166b0 · 2026-05-06 22:03:32 -0700 · Steve
Files touched
Diff
commit 7489430a08643b3def404f3d9040db4789f166b0
Author: Steve <steve@designerwallcoverings.com>
Date: Wed May 6 22:03:32 2026 -0700
/sitemap.xml: per-URL <lastmod> (resolved from underlying HTML mtime when available, fallback to server start) + <priority> per route; SEO win after post-pivot copy sweep so Google recrawls
---
server/server.js | 36 ++++++++++++++++++++++++++++++++----
1 file changed, 32 insertions(+), 4 deletions(-)
diff --git a/server/server.js b/server/server.js
index 3d4538a..d8010cc 100644
--- a/server/server.js
+++ b/server/server.js
@@ -104,6 +104,7 @@ function decryptBlob(envelope) {
const ROOT = __dirname;
const DATA = path.join(ROOT, "data");
const PUB = path.join(ROOT, "public");
+const _serverStartIso = new Date().toISOString();
[DATA].forEach(d => { if (!fs.existsSync(d)) fs.mkdirSync(d, { recursive: true }); });
const CONNECTORS = JSON.parse(fs.readFileSync(path.join(ROOT, "connectors.json"), "utf8"));
@@ -491,12 +492,39 @@ app.get("/robots.txt", (req, res) => {
);
});
app.get("/sitemap.xml", (req, res) => {
- const staticUrls = ["/", "/login", "/services", "/legal-notice", "/how-it-works", "/connectors", "/about", "/faq", "/docs", "/pricing", "/changelog", "/privacy", "/terms"];
- const connectorUrls = CONNECTORS.map(c => `/connectors/${c.id}`);
- const all = [...staticUrls, ...connectorUrls];
+ // Per-URL lastmod resolved from the underlying HTML file's mtime when available; falls back
+ // to server start time for dynamic routes. Helps Google decide which pages to recrawl after
+ // the post-pivot copy sweep.
+ const staticPages = [
+ { url: "/", file: "homepage.html", priority: "1.0" },
+ { url: "/login", file: "login.html", priority: "0.4" },
+ { url: "/services", file: "services.html", priority: "0.9" },
+ { url: "/legal-notice", file: "legal-notice.html", priority: "0.6" },
+ { url: "/how-it-works", file: "how-it-works.html", priority: "0.8" },
+ { url: "/connectors", file: null, priority: "0.7" },
+ { url: "/about", file: null, priority: "0.5" },
+ { url: "/faq", file: null, priority: "0.5" },
+ { url: "/docs", file: null, priority: "0.5" },
+ { url: "/pricing", file: null, priority: "0.7" },
+ { url: "/changelog", file: null, priority: "0.4" },
+ { url: "/privacy", file: null, priority: "0.3" },
+ { url: "/terms", file: null, priority: "0.3" },
+ ];
+ const fallbackIso = (typeof _serverStartIso !== "undefined") ? _serverStartIso : new Date().toISOString();
+ const fileLastmod = (filename) => {
+ if (!filename) return fallbackIso;
+ try { return new Date(require("fs").statSync(path.join(PUB, filename)).mtime).toISOString(); }
+ catch { return fallbackIso; }
+ };
+ const staticEntries = staticPages.map(p => {
+ const lm = fileLastmod(p.file);
+ const cf = p.url === '/' ? 'weekly' : 'monthly';
+ return ` <url><loc>https://${DOMAIN}${p.url}</loc><lastmod>${lm}</lastmod><changefreq>${cf}</changefreq><priority>${p.priority}</priority></url>`;
+ });
+ const connectorEntries = CONNECTORS.map(c => ` <url><loc>https://${DOMAIN}/connectors/${c.id}</loc><lastmod>${fallbackIso}</lastmod><changefreq>monthly</changefreq><priority>0.5</priority></url>`);
const xml = `<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
-${all.map(u => ` <url><loc>https://${DOMAIN}${u}</loc><changefreq>${u === '/' ? 'weekly' : 'monthly'}</changefreq></url>`).join("\n")}
+${[...staticEntries, ...connectorEntries].join("\n")}
</urlset>`;
res.type("application/xml").send(xml);
});
← a129aee teaser coming-soon: '56 connectors/SaaS tools' → '67' across
·
back to Ventura Claw
·
/services demo widget: tighten CTA copy from 'Run this plan' 958d1e1 →