Hacker News new | past | comments | ask | show | jobs | submit login
Saait: a boring HTML page generator (codemadness.org)
35 points by weeber on Jan 24, 2019 | hide | past | favorite | 9 comments



I was considering using bash, some command line markdown transformer, and a makefile to transform my blog posts from markdown into HTML by wrapping them in an HTML template that just have the strings $TITLE, $BODY, and $DATE substituted. I think that would be a fun way to do this with zero C code. One of the hard parts was figuring out how to avoid too many nested data structures, like embedded title in the markdown files via front matter. But I figured out that if all you have is a title and it's a one-line string, you can just use the `head` and `tail` command line utils to extract either the title string or the markdown body depending on which operation you're in the middle of, and you can still just use bash (except for the markdown converter). I plan to use this on my blog[1], and maybe also to generate a blog index.

[1] https://sephware.com/blog/


Links broken.

> But I figured out that if all you have is a title and it's a one-line string, you can just use the `head` and `tail` command line utils to extract either the title string or the markdown body depending on which operation you're in the middle of, and you can still just use bash

I took a similar approach with mine (http://flukus.github.io/building-a-blog-engine.html) but it get's messy pretty quickly. In a future iteration I'm planning on using M4 templates instead, M4 is actually pretty nice outside of autoconf.


You might want to check this out: https://github.com/alicemaz/website

Pretty nifty.


Despite having fewer features, this looks considerably less easy to use (and certainly less well documented!) than Hugo (https://gohugo.io/). Which, being written in Go is probably much easier than this to compile across different platforms (unless you're using a really obscure platform). I can't see much reason to use this.


Coming from zero Jekyll experience: I've spent about a dozen hours with Hugo, and I still have an incredible number of problems with it.

When it works it's quite nice, and the live-reloading is cool. I can totally understand why people like it.

But it falls apart all the time on small mistakes, doesn't tell you when it does so, and doesn't tell you why it's failing to find anything at all simply because you entered a non-existent config value in the borderline-undocumented themes that refer to old config setups or just have copied Jekyll instructions. I've spent about half the time changing config or text and wondering why it wasn't updating, only to discover that the reloading was broken or that I had to delete some earlier-built stuff that it didn't detect needed changing. It has driven me away at least twice, and I still don't know how to find out what went wrong (much less what I need to do to fix it) when I break it.

I've actually been seriously considering switching to Jekyll just to see if it'd be more helpful for learning.

---

This, on the other hand, has a couple interpolation markers and everything else would be defined up-front. I can figure that out in a few minutes and probably use it correctly forever after.


Beat me to it by mere seconds!


The best static site generator I've used is Hugo. Still haven't been tempted to fork it or modify any of the generating code. It has just enough helper functions to be useful. The theme system is really lovely too, with a ton of simple templates to work from. I don't use the built in web server, but it's great for local testing.

I highly recommend it for any text heavy sites.


Cool!

OpenBSD enthusiast Roman Zolotarev has ssg4, a static site generator that's a simple shell script.


If you really want boring you should save users the trouble of compiling c code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: