Files
withered-sanctum-site/src/pages/blog/index.astro
2026-05-06 13:03:45 -05:00

32 lines
575 B
Plaintext

---
const posts = Object.entries(
import.meta.glob('./*.md', { eager: true })
).map(([path, post]) => {
const slug = path.replace('./', '').replace('.md', '');
return {
title: post.frontmatter.title,
url: `/blog/${slug}/`,
};
});
---
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Blog | Withered Sanctum</title>
</head>
<body>
<main>
<h1>Blog</h1>
<ul>
{posts.map((post) => (
<li>
<a href={post.url}>{post.title}</a>
</li>
))}
</ul>
</main>
</body>
</html>