mirror of
https://github.com/mudabbir-ahmad/Portfolio_V1.git
synced 2026-12-06 19:53:09 +00:00
Add link-preview image and Open Graph/Twitter tags
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d73ea4958f
commit
f7bd7df579
4 files changed
+13
-2
No files matched your search
@@ -25,6 +25,7 @@ services:
|
||||
VITE_CV_URL: "${VITE_CV_URL:-/CV/my_cv.pdf}" # e.g. /CV/your-cv.pdf; empty hides CV buttons
|
||||
GITHUB_TOKEN: "${GITHUB_TOKEN:-}" # read-only PAT, set in the gitignored root .env; empty disables the contribution graph
|
||||
ALLOWED_ORIGIN: "${ALLOWED_ORIGIN:-http://localhost:3001}"
|
||||
SITE_URL: "${SITE_URL:-http://localhost:3001}" # public address, used in link-preview tags
|
||||
FORCE_HTTPS: "${FORCE_HTTPS:-false}"
|
||||
# Only if you set VITE_CV_URL: the CV is never baked into the image.
|
||||
volumes:
|
||||
|
||||
+9
-1
@@ -14,13 +14,21 @@
|
||||
name="description"
|
||||
content="__SITE_NAME__, graduate software engineer. Projects, skills, and a homelab."
|
||||
/>
|
||||
<link rel="canonical" href="__SITE_URL__/" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:site_name" content="__SITE_NAME__" />
|
||||
<meta property="og:url" content="__SITE_URL__/" />
|
||||
<meta property="og:image" content="__SITE_URL__/og-image.jpg" />
|
||||
<meta property="og:image:width" content="1200" />
|
||||
<meta property="og:image:height" content="630" />
|
||||
<meta property="og:image:alt" content="__SITE_NAME__, graduate software engineer" />
|
||||
<meta property="og:title" content="__SITE_NAME__, Graduate Software Engineer" />
|
||||
<meta
|
||||
property="og:description"
|
||||
content="Graduate software engineer. Projects, skills, and a homelab."
|
||||
/>
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:image" content="__SITE_URL__/og-image.jpg" />
|
||||
<title>__SITE_NAME__, Graduate Software Engineer</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 50 KiB |
+3
-1
@@ -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");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user