Colocate modules with pages
🌱 This post is in the growth phase. It may still be useful as it grows up.
Put modules that share getter functions and types inside nested
Astro has a “generation one”
.mdx file becomes a page on your site.
Unlike other gen 1
/pages directories (like those in Next.js, pre App Directory), Astro doesn’t read
.tsx modules as pages.
This means you can colocate collection-type specific code there.
Here’s what mine look like, at the moment.
You may see immediate value you this. You may not. I’ll do my best to make the benefits clear in other patterns.