mirror of
https://github.com/mudabbir-ahmad/Portfolio_V1.git
synced 2026-12-06 19:53:09 +00:00
Redesign portfolio, add real project screenshots and refresh content
- New design language: self-hosted fonts, numbered sections, hero card, nav pill with scroll-spy - Two-pane project pop-up with WebP screenshots; gold ring on the final-year project - Content moved to src/data JSON and updated from the new CV - Staggered card entrances and stat count-up; simpler dot cursor - Capture script converts manual screenshots to WebP Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2e67bc1418
commit
89d4de8df0
85 files changed
+4111
-1150
No files matched your search
+30
-2
@@ -178,8 +178,36 @@ app.get(
|
||||
);
|
||||
|
||||
const distPath = path.resolve(__dirname, "../dist");
|
||||
app.use(express.static(distPath));
|
||||
app.get(/^(?!\/api).*/, (req, res) => res.sendFile(path.join(distPath, "index.html")));
|
||||
|
||||
// Runtime site config. `docker run -e VITE_NAME=...` (or secrets/.env when run
|
||||
// directly) fills these in at start-up, so one built image serves any identity.
|
||||
// Only these identity/contact keys are exposed; the GitHub token never is.
|
||||
const PUBLIC_KEYS = ["VITE_NAME", "VITE_EMAIL", "VITE_GITHUB_USER", "VITE_LINKEDIN", "VITE_CV_URL", "VITE_UNIVERSITY"];
|
||||
const publicEnv = Object.fromEntries(
|
||||
PUBLIC_KEYS.filter((k) => process.env[k]).map((k) => [k, process.env[k]])
|
||||
);
|
||||
const escapeHtml = (s) =>
|
||||
s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
||||
|
||||
app.get("/env.js", (req, res) => {
|
||||
res.set("Cache-Control", "no-store").type("application/javascript");
|
||||
res.send(`window.__ENV__=${JSON.stringify(publicEnv)};`);
|
||||
});
|
||||
|
||||
// index.html with the site name filled into the <title>/meta tags.
|
||||
let indexHtml = "";
|
||||
try {
|
||||
indexHtml = fs
|
||||
.readFileSync(path.join(distPath, "index.html"), "utf8")
|
||||
.replaceAll("__SITE_NAME__", escapeHtml(publicEnv.VITE_NAME || "Your Name"));
|
||||
} catch {
|
||||
console.warn("dist/index.html not found, run `npm run build` first");
|
||||
}
|
||||
const sendIndex = (req, res) => res.type("html").send(indexHtml);
|
||||
|
||||
app.get("/", sendIndex);
|
||||
app.use(express.static(distPath, { index: false }));
|
||||
app.get(/^(?!\/api).*/, sendIndex);
|
||||
|
||||
const server =
|
||||
TLS_CERT && TLS_KEY
|
||||
|
||||
Reference in new issue
Block a user