7 ms·
I've been trying to make a cool static site generator numerous times. Well, yes, it actually is a quite fun thing to tinker with, but I've found myself struggli
by impoppy 4y ago
I've been trying to make a cool static site generator numerous times. Well, yes, it actually is a quite fun thing to tinker with, but I've found myself struggling to decide on what do I want to see in the final app and what I do not; what features might be needed by other users and what features might be an overkill. So I ultimately went with Zola[1] and encourage you to try it too! Aaaand it is written in Rust, too. It's available in Alpine Linux's repos so it's trivial to set up a CI/CD to compile your blog.
[1] https://www.getzola.org/ https://www.getzola.org/
- asicsp 4y agoI moved from Jekyll to Zola and it's been great until I started tinkering with templates and stuff recently. Single binary and simple themes were main reasons to choose this. Wanted a feature that wasn't present in the version I started with (about 2 years ago). So, I got the newest version and a few things broke subtly (ex: syntax highlighting). Which led me to tinkering (I don't know much about HTML/CSS/etc). It was actually good to try a few things almost blindly and then slowly narrowing with a bit more thought process. Been a long time since I had such fun investigating unknown codebase. This even helped me move my post processing scripts to templates. And then I went a step further by reading about meta tags (things like image, description, etc) and adding them via an extra variable in the post frontmatter.
- impoppy 4y agoThat's exactly why I never used Jekyll and don't really understand people that use it nowadays. It is AWFUL. Not only it uses greatly outdated Ruby, you also HAVE to install outdated Ruby on your machine to play with themes, serve, compile and are forced to use RVM. I know GitHub Pages can compile the page for you, but when you want to customize a theme you have to go through all that hell. It's just a terrible experience. And installing plugins is another hell.
- BrandonS113 4y agoI use Jekyll for a few sites and it works perfectly. Design is bootstrap and so nothing to do with Jekyll and it always compiles the site, takes a few seconds. Works fine on my mac and linux. Would I have picked Jekyll today? no. Is it worth the cost of switching? no.
- burntsushi 4y agoI plan on writing a static site generator soon myself. And I briefly wondered the same thing and realized that I could very easily answer that question: ruthlessly build whatever I personally need and not what others need. I don't usually follow that line of thinking, but the static site generator space is so full of so many great tools that I don't think there's really anything for me to contribute to it. Instead, I think the killer feature of my static site generator is going to be exactly what makes it difficult for others to use: its tight coupling with my specific use case. I'll be able to hard-code configuration knobs. Avoid dealing with edge cases. Bake strange non-generic and single-blog-post-specific logic right into the tool. (The reason why I want to build my own is because I've tried using someone else's. And I just keep getting bitten: someone else's tool gets so big and moves so rapidly, that by the time I get around to updating my site, something about the new version of the tool has broken the way my web site works. And then I usually have to spend hours figuring out how to fix it, which is hugely deflating because I had just worked up the energy to write a new post. My naive belief is that if I have my own tool that evolves at precisely the pace I want it to, I won't run into that specific problem. I'll run into other problems of course, but I'm thinking that I'll prefer those problems to the ones I currently face.)
- impoppy 4y agoSounds cool, I hope one day I stumble upon your article that utilizes those very custom hard-coded knobs. Yet I wouldn't make a tool like that since tools should be KISS.
- burntsushi 4y agoKISS is exactly my point. :)
- epage 4y agoYou should check out what fasterthanlime does for their blog. Theirs uses sqlite for storing all state and the write plugins into the Rust Liquid template implementation to directly query sqlite so they could do whatever they wanted without recompiling. It was pretty neat. I have been looking to break out parts of static-site-generators to make it easier to bring one up. So far I only have two primitive building blocks - https://docs.rs/engarde/latest/engarde/ https://docs.rs/engarde/latest/engarde/ - https://docs.rs/file-serve/latest/file_serve/ https://docs.rs/file-serve/latest/file_serve/
- cletus 4y agoFinding a good static site generator wasn't really the author's point. It was more for the fun of writing something in Rust. But I appreciate the link to Zola. I haven't looked in this space for awhile and it looks good.
- impoppy 4y agoYou’re welcome! Just wanted to share what did I come to in the end following the same route.
- nivenkos 4y agoI'm literally in the process of porting my blog to Zola right now (from Octopress). One issue I hit is that taxonomies aren't available at the section-level (nor are they section-specific, in case you want to treat sections as sub-sites), this makes it seemingly impossible to have a section taxonomy view. I might try to patch it, but it's tricky as it's like merging the taxonomy code with the page and section rendering.
- alphachloride 4y agoI went with Hugo. It is written in Go. If I were to make my own generator from scratch, I'd go with python. It's the language I work with the most. A lot of my blog content will be generated from python (figures etc) or will show python code. So having a site generator in the same language can help me add features by hacking on the generator code in a way that a single binary cannot.
- impoppy 4y agoOn the other hand, having single binary is good because you don't have to install the runtime to tinker with the tool. Yet I do agree that tinkering options are very limited in comparison.
- Macha 4y agoI migrated from Pelican (Python) to Zola (Rust) because of the ease of replication of the environment. After a few years it was a pain to recreate my pelican environment and even the tools I'd used to try make that situation easier (pipenv) were undergoing their own bitrot.
- ducharmdev 4y agoI went with Hugo too. I used Gatsby in the past, but it was slower and it felt a bit odd using GraphQL in the way it does. Maybe that'd make more sense if I was using an API to deliver content, but for simple markdown pages, it seemed unnecessary.
- Keats 4y ago> I've found myself struggling to decide on what do I want to see in the final app and what I do not; what features might be needed by other users and what features might be an overkill. It's tricky. You can't accept all the features otherwise you just have a mess. At the same time you need to also add/supports features that a lot of people want but _you_ personally don't need if you want the tool to be used by more than 1 person. For example with SSG I don't use themes, I just write my own templates for every site. Despite that I still added it to Zola because most people want themes. Some people will not be happy when you say no to some features they want but hey, it's open-source they can always fork it.
- epage 4y agoStoring the internal state in sqlite and allowing Lua plugins to operate on it might be a way of extending things.
- sureglymop 4y agoI ended up making mine with Pandoc + Make. At first i used Nextjs and Remark/Unifiedjs but then I had a realization that all that is not even needed.
- ayushnix 4y agoHave you come across Soupault yet? I'm considering using Pandoc with Soupault to my website markup agnostic by being dependent on Pandoc. Soupault can act as a HTML processor although I'm not sure if that's enough to not need a template langauge. Or maybe I'm mistaken about Soupault. https://soupault.app/ https://soupault.app/
- sureglymop 4y agoLooks pretty cool, thank you! My makefile is pretty simple (3 lines) but I'll see if maybe this is more suitable. :)
- ignite 4y agoMy static site generate is enough python to invoke mustache on every file in a directory. Maybe 70 lines That's it. Works fine. Not everything is improved by creeping featuritis.
- tmpfs 4y agoI did this as my project to learn Rust, to build with all the features needed for a good static site generator was a great way to learn! I still haven't released it as there are some bugs (localization!) that i need to fix but if you want to have a play the staging site is here[1]. [1] https://stage.uwe.app/ https://stage.uwe.app/