10 ms·
Show HN: Blades – fast static site generator written in Rust
- twarge 6y agoCobalt https://cobalt-org.github.io https://cobalt-org.github.io
- forgotmypw17 6y agoI'd say just by using YAML this already loses out to the posted project :)
- itsjloh 6y agoWhy do you say that? I find TOML much harder to write compared to YAML.
- marosgrego 6y agoYeah, TOML is kind of more verbose. However, its syntax is uniform (`key = value`) and there is no way to shoot yourself in the foot.
- libria 6y agoThanks for the link, it's always good to know about similar alternatives.
- desireco42 6y agoDang this is nice. I just built two sites, one with Hugo and other in Eleventy, but this is nice and I can see how useful it can be ie. would love to use it for next excuse for website. Thanks for sharing.
- forgotmypw17 6y agoNice work, thank you for sharing! Great job on the 386 theme. Documentation is understandable and easy to dive into. Great design, and rather complete feature-set. TOML looks like a great format, too.
- bacondude3 6y agoAll I want is a static site generator that sits in an executable file in my project's directory and doesn't require any dependencies so that I can run `./ssg build` and have all of my Markdown files interpolated into my template files and put in their own directory. I don't want to have to install all of the dependencies for Ruby or Hugo or Blades, cool as this project looks. Are there any SSGs that fill that niche? (A Python executable would be fine since pretty much every Linux computer has Python, but I don't want to have to deal with pip).
- thrwwayanswerq 6y agoHugo or any go program should fit that bill since that is one of the major selling points of go Hugo has a ton of prebuilt executables that you just have to extract and its in a single file https://github.com/gohugoio/hugo/releases https://github.com/gohugoio/hugo/releases
- bacondude3 6y agoThanks. I had looked at Hugo before, but somehow didn't see the precompiled binary as an installation option. I'll try it out.
- coldtea 6y agoYou don't need to use their precompiled binary either. It's available in brew (OS X), some Windows package manager (don't remember the name), distro packages, etc.
- bacondude3 6y agoYeah, but package managers are exactly what I want to avoid here :)
- lalaithion 6y agoThey say "If you would like to have it included in your favourite package repository, submit an issue."
- chrsstrm 6y agoI'm going to try this out at some point this week, but the one item that makes me pause: the sitemap. Hugo is fast, but it doesn't do incremental builds. Once you get to the point where you're publishing 10's of thousands of posts, Hugo starts to get real slow (like 20 minutes to build, even after enabling template caching), so an increase in speed during build time is welcome. But once you get to 50K posts you realize that Hugo doesn't follow Google's convention to break your sitemap into separate files with an index map[0]. Hugo doesn't have a handler for this and as of now I haven't figured out how to modify the sitemap compilation process to be compliant (not like I've tried too hard, I'm not native with Go and the code isn't clear to me where the sitemap is being built). If Blades would handle the sitemap issue for me without needing a plugin or modification, that would be huge for a lot of people on the Hugo community boards. [0] https://support.google.com/webmasters/answer/183668?hl=en https://support.google.com/webmasters/answer/183668?hl=en
- gcatalfamo 6y agoYou are not wrong, although I would argue that use cases where you have 50k blog posts (or pages) are not that common...
- chrsstrm 6y agoI should have been more clear on the terminology - 50K URLs. Which doesn't always mean 50K posts or pages, but those plus all your taxonomy pages plus all your pagination pages. A 10K post or page site can give you 50K URLs pretty easily if it uses taxonomies and pagination. My case might be unique where the site is being built at the end of a pipeline that sorts through millions of rows of data and gives you the content you want based on your filters, but it's honestly not difficult to get to 50K URLs for many sites that have some age on them.
- codegeek 6y agoI would say a 10k page or post site is also very rare.
- cipherzero 6y agoThis is neat! Good work. Was any of this inspired by Zola? https://www.getzola.org/documentation/getting-started/overview/ https://www.getzola.org/documentation/getting-started/overvi... I’ve used Zola and love the build speed and power that it has. My only real complaint is common mark as the markdown engine. I prefer the tera/jinja2-esque template syntax over ramhorn/mustache-esque that’s used here. I’ll have to try and port a theme to blades to give it a fair assessment.
- marosgrego 6y agoCertainly, I have known Zola for a while and it has a nice feature set.
- hendry 6y agoI wish for a static site generator with back links https://www.youtube.com/watch?v=9aM3JzBJ6qo https://www.youtube.com/watch?v=9aM3JzBJ6qo
- woile 6y agoHey super nice! I would add some more info to the docs: formats supported (md, rst?, etc), if it is also a blog generator I would include that info. Looks pretty awesome and simple, thanks for sharing!
- marosgrego 6y agoIt only supports CommonMark markdown now. Maybe I should state it more explicitly somewhere.
- AnonC 6y agoIt would be great if every new static site generator had a page that has comparisons with the ones that came before...at least for the ones in the same language and same deployment model (or dependencies). After going through this site, I was left wondering (as someone who hasn't used Rust based SSGs) what the differences are between Blades, Zola and Cobalt. The site says that it's a hobby project, but additional marketing with comparisons is always useful to get more eyes (and possibly more contributors too).
- mhd 6y agoAnother static-binary static-site generator I've recently discovered is Soupalt[1]. Which adds OCaml to the list of languages for that kind of thing, with extensibility via Lua. Has a a more unopinionated approach to thing, instead of just markdown expansion, it's also a generic HTML postprocessor. [1]: https://soupault.neocities.org/ https://soupault.neocities.org/
- marosgrego 6y agoVery interesting project, thanks for sharing! CommonMark supports HTML tags, so one can currently also write pages in plain HTML if they want to.
- higerordermap 6y agoOff topic: Any aggregated lists of sufficiently mature projects in "new" languages (rust, nim etc)? That would be helpful for people searching for some idiomatic code. Also to evaluate performance etc.. characteristics of the language.
- marosgrego 6y agoBlades author here. Just added it to AUR for more convenient install for people who are not Rust developers: https://aur.archlinux.org/packages/blades-bin/ https://aur.archlinux.org/packages/blades-bin/