Add link-preview image and Open Graph/Twitter tags

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbertandClaude Haiku 5.5 committed 2026-10-09 03:57:18 +01:00
1 parent d73ea4958f
commit f7bd7df579
4 files changed
+13 -2

No files matched your search

+3 -1
View File
@@ -199,7 +199,9 @@ let indexHtml = "";
try {
indexHtml = fs
.readFileSync(path.join(distPath, "index.html"), "utf8")
.replaceAll("__SITE_NAME__", escapeHtml(publicEnv.VITE_NAME || "Your Name"));
.replaceAll("__SITE_NAME__", escapeHtml(publicEnv.VITE_NAME || "Your Name"))
// Absolute URLs for link previews (og:image needs one). Set SITE_URL to the public address.
.replaceAll("__SITE_URL__", escapeHtml((process.env.SITE_URL || ALLOWED_ORIGIN).replace(/\/$/, "")));
} catch {
console.warn("dist/index.html not found, run `npm run build` first");
}