Files
Tiber365/src/pages/blog/[slug].astro
2025-07-24 18:46:24 +02:00

28 lines
722 B
Plaintext

---
export async function getStaticPaths() {
// Get all blog posts to create redirects
const { getBlogPosts } = await import('../../utils/directus');
const posts = await getBlogPosts();
return posts
.filter((post) => typeof post.slug === 'string' && post.slug.trim() !== '')
.map((post) => ({
params: { slug: post.slug },
props: { slug: post.slug },
}));
}
const { slug } = Astro.props;
---
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Redirecting...</title>
<meta http-equiv="refresh" content="0;url=/en/blog/{slug}">
<link rel="canonical" href="/en/blog/{slug}">
</head>
<body>
<p>Redirecting to <a href="/en/blog/{slug}">blog post</a>...</p>
</body>
</html>