4 ms·
I have an 84 line bash script that abuses find, sed and multimarkdown to generate a website with a blog, static pages, navigation and rss feed for the blog. The
by nico_h 5y ago
I have an 84 line bash script that abuses find, sed and multimarkdown to generate a website with a blog, static pages, navigation and rss feed for the blog. The index page has a header and the last 5 blog entries ((Navigation between the blog entries is plain old basic javascript).(https://github.com/nicolasH/frankensteins https://github.com/nicolasH/frankensteins)
You don't have to be on the Node treadmill to create a static site generator. You can use something stable!
- wheybags 5y agoMine is similar, but I use the C preprocessor for templating (you can run it independently, by running `cpp`)
- nico_h 5y agoIt works by concatenating html files with some minimal replace. So it's easy to edit and update. If it ever becomes too slow, maybe I look into using xargs -P or adding more '&' between commands.
- spaniard89277 5y agoI just use PicoCMS and I forget about it. Just upload markdown files, that's about it.
- Zababa 5y ago> You don't have to be on the Node treadmill to create a static site generator. You can use something stable! Node isn't always a treadmill. JavaScript itself is very stable, much more than many other languages. The big thing you need is something to transform markdown to HTML. You can either write it yourself, or take one that's stable. The rest can be done in plain JS, without libraries.
- cxr 5y agoI notice that people who bring up shell scripts or makefiles in these types of discussions tend to tout the virtues of their setup based on those alone—putting undue focus on the glue layer, instead of the parts doing the heavy lifting—and this behavior strikes me as very odd. Shell scripts are only as stable as the executables that they invoke (and portability is a separate matter worth taking into account, too—few people who mention stability address the issue of incompatible variations of shell and make across different systems). In this case, the upper bound is determined by peg-multimarkdown that you depend on.
- p4bl0 5y agoI have my own too. It is a Makefile that makes extensive use of the core utils (sed!) and xml2 and 2xml to be able to process HTML using the line-oriented tools in the core-utils. I also built a blog engine on top of git using sh scripts and the core-utils in git hooks (https://p4bl0.net/shebang/fugitive-readme.html https://p4bl0.net/shebang/fugitive-readme.html), but that was a long time ago and I don't use it anymore. It had a dozen users at some point and I even received a few contributions to the project. Fun times :).
- deleted 5y ago[deleted]
- salamander014 5y agoMine uses pandoc and core utils to convert markdown to html and shoves it into an existing page template to create a blog post. I could add menu / link tracking pretty easily but I don't need it. My script is less than 15 lines long and can convert any number of markdown files into their own pages on my site, ready to serve.
- sigg3 5y agoYou can probably do most of it in awk. I've done most of this in awk.
- omarhaneef 5y agoOne big benefit would be you could release the Static Site Generator as “Awk Word”, which is a pun I've been trying to make for month.
- rsj_hn 5y agoWow, you've just made my life better.