Add projects page

This commit is contained in:
sepia 2025-08-02 18:46:45 -05:00
parent 232855e952
commit f2ddb2b5c5
4 changed files with 37 additions and 4 deletions

View file

@ -35,6 +35,20 @@ const app = new Elysia()
return "Internal server error";
}
})
.get("/projects", async ({ set }) => {
try {
const content = await fs.readFile(
path.join(process.cwd(), "data/pages/projects.html"),
"utf8",
);
return renderTemplate("index.html", { content });
} catch (error) {
console.error("Error serving main page: ", error);
set.status = 500;
set.headers["Content-Type"] = "text/plain";
return "Internal server error";
}
})
.get("/posts/:post_name", async ({ params, set }) => {
try {
const filePath = path.join(