From 26243ccc692c93a87b8095a17774dcb3273c667c Mon Sep 17 00:00:00 2001 From: h4ckx0r Date: Tue, 4 Mar 2025 09:27:23 +0100 Subject: [PATCH] Arreglo del import en los posts --- src/pages/posts/[id].astro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/posts/[id].astro b/src/pages/posts/[id].astro index 79a5580..f3fa108 100644 --- a/src/pages/posts/[id].astro +++ b/src/pages/posts/[id].astro @@ -16,8 +16,8 @@ export async function getStaticPaths() { const { post } = Astro.props; const { Content } = await render(post); - -const postMD = await import(/* @vite-ignore */ `../../../${post.filePath}`); +const cleaned = post.filePath.replace(/^src\/posts\//, "").replace(/\.mdx$/, ""); +const postMD = await import(`../../posts/${cleaned}.mdx`); const headings = postMD.getHeadings(); const description = post.data.descripcion;