Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

510
Vistas
How to print blog post content in the source code of the page while importing '.md' files dynamically?

I'm putting together a blog with Sveltekit and markdown files. And my blog url structure differs from where my original writings in .md format are saved.

I can get the posts from the folder using dynamic import as:

<script>
    import { page } from '$app/stores';

    //get current post name
    const pageName = $page.url.pathname;
    const postUrl = pageName.split('/');
    var lastSegment = postUrl.pop() || postUrl.pop(); // handle potential trailing slash
</script>

{#await import(`../../posts/${lastSegment}.md`) then value}
    <svelte:component this={value.default} />
{/await}

and they are shown on the page but not in the source code. I'm sure it'll have an impact on SEO. So, my issue is, how can I display the content in the page's source?

p.s. I'm also using MDSVEX.

Thanks in advance.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda