Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

503
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda