4 ms·
I use a very similar stack to host my personal website that contains a blog and a collection of other pages. Here are the similarities between my stack and that
by susam 5y ago
I use a very similar stack to host my personal website that contains a blog and a collection of other pages. Here are the similarities between my stack and that of the author of this post:
- No JavaScript except for loading MathJax only on those pages that contain mathematical equations.
- No cookies, no banners, no account creation, no ads, no affiliate links.
- All content and code is stored in a Git repository.
- The HTML files are served using Nginx.
- The website is hosted on a Debian system.
- No load balancer, no database, no cache server, etc.
However, there are some differences too. Here are the differences between my stack and that of the author of this post:
- All my content is written in plain HTML. Some of the content in my website goes back to 2001 when the obvious way to write content was in plain HTML. I know that Markdown can be easier to write and read and I do use Markdown for GitHub READMEs. However, for my website, I just stayed back with HTML.
- I have my own small Common Lisp program to generate the static HTML files. It picks all the content HTML files, puts them within a common HTML template to ensure headers and footers are consistent across pages, generates a blog post list page, generates RSS feeds, etc.
By the way, I use Emacs for editing HTML. Its HTML+ mode has a pretty good collection of key sequences for editing HTML. For example, the key sequence C-c 2 inserts "<h2></h2>" and places the cursor in between the tags so that I can start typing the heading immediately, C-C C-o enters an arbitrary tag along with its closing pair (if applicable) and places the cursor in between the tags, C-c C-e automatically closes any open tag, etc. These key sequences along with automatic indentation of nested HTML elements by Emacs does a really good job at making editing plain HTML very convenient.
- umvi 5y agoYep I recently did exactly this for my personal site as well (including initially writing HTML by hand), but instead of lisp I wrote a ~100 line python script[0] so that I could write future content in Markdown instead of HTML. Yes I'm aware of Jekyll and Hugo and such, but even those were too complex for my personal site. It only took about an hour of my time to write it, and now anytime I push markdown changes to my git repository, GitHub Actions runs the markdown through the python script and generates the site which is hosted on GitHub pages. [0] For the curious - https://gist.github.com/RPGillespie6/b133854b8ebf5a983cf32c26d684cff3 https://gist.github.com/RPGillespie6/b133854b8ebf5a983cf32c2...
- Shared404 5y agoI'll jump on this bandwagon too. I did it in Rust, because I wanted to learn Rust. It just takes a directory structure with markdown files, and converts each file to HTML while adding a header and footer. I use it on a few sites now, and honestly I should redo the code but it works conveniently and I have other stuff to do. Oh, and my stack is nginx on Alpine currently. Edit: Code is here: https://git.sr.ht/~evan-hoose/SSSSS https://git.sr.ht/~evan-hoose/SSSSS It really is not great code. It even shells out to markdown to do the rendering - bad for all sorts of obvious reasons. (but the right choice for my use case). If you want to use it, be my guest. Just know that it's bad and ugly and you could write it better yourself in not very long.
- qchris 5y agoJumping on the bandwagon of the guy that jumped on the bandwagon, because you mentioned potentially re-doing your own code at some point so might be interested: my personal site [0] looks very much like this (and is also written in Rust), but uses the comrak [1] crate to convert blog posts from Markdown to HTML on the fly before formatting with the header/footer theme. Using comrak lets you write in-line HTML (so you're not stuck with only Markdown syntax if you want to do something fancier like code blocks or <math></math>), and the whole site ends up <150 LoC, including route definitions. It handled the one potential HN hug-of-death event I've had without issues while running on the smallest DO droplet offered, and has basically been issue-free since I got it up and running. [0] https://github.com/quietlychris/site https://github.com/quietlychris/site [1] https://github.com/kivikakk/comrak https://github.com/kivikakk/comrak
- Shared404 5y agoLooks interesting, thanks! I may very well do something similar at some point, though I've also thought about using it as an excuse to redo whenever I want to learn $LANGUAGE, or writing a markdown (or subset of markdown) interpreter at some point. Definitely going to read through the code more closely as well - I've been meaning to find some short and well written Rust.
- 5y ago
- klodolph 5y agoI've also stuck with plain HTML for my personal website, and stayed away from stuff like Markdown. It feels like too often, with Markdown, I'd be figuring out questions like "how do I get Markdown to emit the HTML that I want?" It's not like Markdown saves me that much typing over HTML in the first place, and the HTML is a lot easier to think about. And yes... Emacs is my HTML editor of choice, too.
- Topolomancer 5y agoVery much in the spirit of Jeff Huang: https://jeffhuang.com/designed_to_last/ https://jeffhuang.com/designed_to_last/ I have to admit that I like the 'bare' feeling of Markdown...it just looks a little bit 'cleaner' to me (quotes here because that is super subjective).
- softwarebeware 5y agoYou should be able to write HTML into any Markdown document therefore having the best of both worlds
- klodolph 5y agoTo be perfectly honest, that sounds terrible. Like, just completely awful. I definitely don't want to do that. HTML by itself is easy enough to work with. The syntax for HTML is pretty basic. A little verbose sometimes, but since the late 1990s it has not been hard to find a text editor that will do things like autoindent and insert closing tags automatically. Markdown introduces a ton of weird syntax to save you a little bit of typing. That's a good tradeoff when you are striving to keep people engaged with your site... that's the reason why Markdown is used on places like Stack Overflow, Reddit, a bunch of blogs, etc. Asking people to learn how to use BBCode is a kinda tall order compared to Markdown. However, the cost-benefit of Markdown is completely different on a my personal blog. I'm using somewhat more complicated stuff on my blog... a few standard elements like boxes that say "note", a couple charts here and there with D3, occasionally something interactive, maybe some math with KaTeX. It's not super-complicated stuff, but it's stuff that's often no fun to try and write in Markdown. Even <table> is nicer in HTML than Markdown. I would rather deal with one simple syntax (HTML) rather than a weird mix of two syntaxes (HTML + Markdown) where one of them (Markdown) has bunch of weird edge cases. As far as I can tell, the main benefit of Markdown for personal blogs is that it's slightly less typing. Not exactly a killer feature in my eyes. (It's also very frustrating when trying to write technical documentation.)
- cutler 5y agoI worked with Perl's Template::Toolkit for many years and would still recommend it for static site generation. TT3 is the current version.
- dredmorbius 5y agoHaving written a heck of a lot of raw HTML, Markdown, LaTeX, [gnt]roff, Docbook, and probably a few other markup formats: - Markdown is quite close to plain-ASCII writing. (AsciiDoc or reStructured Text might be even better). - Markdown + pandoc gives a tool for producing numerous output formats or endpoints, including PDF, ePub, and others. - Markdown avoids fiddly bits like balancing open/close tag pairs. - Markdown supports features such as footnotes and tables of contents which HTML does not have simple and easy equivalents for. Yes, there are things which are possible in HTML which Markdown itself doesn't readily provide. Off the top of my head: underlined text, coloured text, and nested superscripts. That said, these are either infrequent needs or are better accomplished through other means (e.g., styles, code-highlighting within code blocks, etc.). Markdown does allow for about 99.9% of my HTML-tagging needs, with a lot less overhead and cleaner syntax. Which is a win. If I were to move in any direction, it would probably be LaTeX for more complex source documents.
- klodolph 5y agoIt's kind of annoying to see links to other comments in the thread. https://news.ycombinator.com/item?id=30142334 https://news.ycombinator.com/item?id=30142334 Markdown syntax IMO is pretty fiddly. I find myself messing with spacing, or with line breaks between list, or things like that. On the whole I find Markdown more annoying than HTML... Markdown is just less typing. "Markdown" doesn't support TOCs or footnotes any more than HTML does... both TOCs and footnotes are non-standard extensions to Markdown that your particular Markdown engine may support, in ways which are frequently incompatible with other Markdown engines. I found it no trouble to put footnotes in my HTML-based static site generator anyway. I don't expect TOCs would be any different, but I don't use TOCs on my site. Superscripts of any kind are a Markdown extension in the first place, and I'm always so unsure where the superscript ends that I have to try different things and reload the preview until it looks right (this is one of those fiddly bits that drove me away from Markdown). I guess if you want to target PDF + ePub and others, yes, use something like Markdown. I'm putting video content or interactive content in my blog often enough that it's just not something that would work anyway. Don't get me wrong... I love using Markdown for stuff like READMEs on GitHub. It's just that for something like my blog, where I put a bit more care into things, Markdown really gets in the way.