32 lines
575 B
Plaintext
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> |