Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

511
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!