I threw thousands of files at Astro and you won't believe what happened next...
Briefly

I threw thousands of files at Astro and you won't believe what happened next...
"I began by creating a soft link locally from my blog's repo of posts to the src/pages/posts of a new Astro site. My blog currently has 6742 posts (all high quality I assure you). Each one looks like so: --- layout: post title: "Creating Reddit Summaries with URL Context and Gemini" date: "2026-02-09T18:00:00" categories: ["development"] tags: ["python","generative ai"] banner_image: /images/banners/cat_on_papers2.jpg permalink: /2026/02/09/creating-reddit-summaries-with-gemini description: Using Gemini APIs to create a summary of a subreddit. --- Interesting content no one will probably read here..."
"In my Astro site's index.astro page, I tried this first: const allPosts = Object.values(import.meta.glob('./posts/**/*.md', { eager: true })); And immediately ran into an issue with the layout front matter. Astro parses this and expects to find a post component in the same directory. My "fix" was to... remove the symbolic link and make a real copy and then use multi-file search and replace to just delete the line."
A soft link to src/pages/posts containing 6,742 Markdown files caused parsing issues and severe slowness. Each Markdown file contained frontmatter fields such as layout, title, date, categories, tags, banner_image, permalink, and description. Using import.meta.glob with eager loading triggered Astro to parse layout frontmatter and expect a post component in the same directory. Copying files and deleting the layout line fixed parsing but resulted in extremely slow loads (~70 seconds). Moving content out of src/pages and defining content collections via a src/content.config.js file using defineCollection and Astro loaders provided a much better solution.
Read at Raymondcamden
Unable to calculate read time
[
|
]