Arreglo del import en los posts

This commit is contained in:
2025-03-04 09:27:23 +01:00
parent 694e642cf4
commit 26243ccc69

View File

@@ -16,8 +16,8 @@ export async function getStaticPaths() {
const { post } = Astro.props; const { post } = Astro.props;
const { Content } = await render(post); const { Content } = await render(post);
const cleaned = post.filePath.replace(/^src\/posts\//, "").replace(/\.mdx$/, "");
const postMD = await import(/* @vite-ignore */ `../../../${post.filePath}`); const postMD = await import(`../../posts/${cleaned}.mdx`);
const headings = postMD.getHeadings(); const headings = postMD.getHeadings();
const description = post.data.descripcion; const description = post.data.descripcion;