1
---
// component imports
import MainLayout from "../../layouts/MainLayout.astro";
---

<MainLayout title="My Blog">
    <ul>
        <li><a href="./post-1.md/"> post-1</a></li>
        <li><a href="./post-2.md/"> post-2</a></li>
        <li><a href="./post-3.md/"> post-3</a></li>
        <li><a href="./post-4.md/"> post-4</a></li>
        <li><a href="./post-5.md/"> post-5</a></li>
        <li><a href="./post-6.md/"> post-6</a></li>
    </ul>
</MainLayout>

file structure: file structure

Astro version 9.5.1

http://localhost:3000/blog/post-1.md/ shows page not found instead of showing the markdown file.

1 Answers1

3

You don’t need to include the .md extension in the URL — this is stripped away for you by Astro, so that for example src/pages/blog/post-1.md becomes available at http://localhost:3000/blog/post-1/.

swithinbank
  • 1,127
  • 1
  • 6
  • 15