I'm a creating a blog using Remix.
Remix supports MDX as a route, which is perfect for me, as I can just write my blog posts as .mdx
files and they'll naturally become routes.
However, if you access the index route - I would like to display the list of links to all the articles, (ideally sorted by creation date, or some kind of metadata in the .mdx file).
I can't see a natural way to do this in the Remix documentation.
Best solution I've got is that I would run a script as part of my build process, that the examines the routes/
folder and generates a TableOfContents.tsx
file, which the index route can use.
Is there an out of the box solution?
The remix documentation does hint at this, but doesn't appear to provide a solid suggestion.
Clearly this is not a scalable solution for a blog with thousands of posts. Realistically speaking, writing is hard, so if your blog starts to suffer from too much content, that's an awesome problem to have. If you get to 100 posts (congratulations!), we suggest you rethink your strategy and turn your posts into data stored in a database so that you don't have to rebuild and redeploy your blog every time you fix a typo.
(Personally, I don't think redeploying each time you fix a typo is too much of a problem, it's more I don't want to have to manually add links everytime I add a new post).