4 ms·
Hey thanks! :D It’s almost all custom (you can see the source on my GitHub https://github.com/brundonsmith/website https://github.com/brundonsmith/website) Mo
by brundolf 5y ago
Hey thanks! :D
It’s almost all custom (you can see the source on my GitHub https://github.com/brundonsmith/website https://github.com/brundonsmith/website)
Most of the site is statically generated at startup using regular JS template strings, and then served as static files (cached in-memory) by Express. Posts are written in Markdown, and code blocks are processed into language-highlighted HTML using Prism.
The only dynamic bit is the HN comments, since I want those to stay fresh. My Node server queries the Algolia HN API to get all comments for the top HN link for the post (since there could be more than one), munges the data a bit, renders it as HTML, and then caches it for one minute. Some client-side JS just hits the endpoint and dumps the HTML into the page.
Any rich rendering inside comment bodies, like for code blocks and italics, actually comes directly from HN itself! The content I get has already been processed from HN’s special markup syntax into HTML, though of course the structural content around the comment bodies is custom.
Basically what I’ve found is that people often ask good questions under my posts, and the discussion/my responses end up being a valuable part of the post itself (clarification, expansion, etc), so I wanted that extra context to be available for people who don’t find my posts via HN. That’s also why I highlight my own comments in that view; I see them as a part of the blog post.
This site is my relaxing project that I tinker with occasionally, so sometimes I over-engineer parts of it a little bit for fun :)