A Plan for the Future
Hi,
I'm trying to get into the habit of writing more and publishing more of my research in an easier-to-consume medium. Blogs on Substack and Medium are nice, but I like having full control of it all.
As such, I now have this system that allows me to write markdown and have it generate HTML, CSS, and JS to serve to the user statically, in my case, hosting it on GitHub Pages.
So let's talk about how we did it.
The stack
I chose to keep things vanilla and easy. Don't use frameworks. Use Tailwind CSS and use libraries whenever you can (for charting, icons, animations, 3D scenes, etc.). Why? Because I hate build steps.
The HTML you write is the HTML you serve. Why complicate things at your level? Let Cloudflare figure out how to optimize the file for you; don't worry about it.
So, how can we make a system like this? Keep in mind this stack is what I am using for LLMs to write code efficiently with, so keeping things minimal is a must.
But why vanilla JS? Well, I lied to you. We are actually using https://alpinejs.dev/, but it is so minimal that I consider it pseudo-vanilla. Alpine provides a very HTMX-like way of doing things, but without the drawbacks of HTMX.
For styling, we chose Tailwind CSS. Since it is so ubiquitous, well-known, and supported by the community, we couldn't choose anything else. We are getting the script via CDN.
And then we need the magic to make it all happen: "Eleventy," a tool that takes your markdown and creates HTML for it from your template files. We just commit all the posts_md results into the posts/ directory using a GitHub action after each commit, and we are done!
So magical! So fast! Love it.
And of course, you can still add any JS library you need.
And now you don't have to worry about having a server for your personal site or blog site.
Conclusion
The tech is very cool, but we still have to finalize the styling on the generated templates. Either way, I already really like this workflow. I almost want to have an Obsidian vault hooked up in the same way!
Publishing all your public notes automatically to share in a version controlled esy must be awesome. we could technically link a git submodue and have it be somewhere else or a similar solution.
i am so excited, and the best part is that we dont have to pay anything for the hosting.