28 lines
722 B
Plaintext
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> |