---
export const prerender = true;
import { getCollection } from 'astro:content';

export async function getStaticPaths() {
  const posts = await getCollection('blog');
  
  return posts.map((post) => ({
    params: { id: post.id },
    props: { slug: post.id },
  }));
}

const { slug } = Astro.props;
return Astro.redirect(`/blog/${slug}`, 301);
---
