Show HN: Blades – fast static site generator written in Rust
getblades.org
getblades.org
[0] https://support.google.com/webmasters/answer/183668?hl=en
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.
(not indicating Aeolun specifically, just replied to the lowest level)
I always got the impression that they were more for small blogs/sites.
If you don't need the user roles and editor experience you get from WP then you can feed your generator the content from any source you like as long as the files have the correct frontmatter to turn them into pages/posts. You might need a little glue script here and there to chain systems together, but it's not super difficult to adapt to whatever pipeline you need after you understand where your content comes from.
Everything after the first request is cached by a CDN anyway so the only difference is when that original page is generated. It only takes a few milliseconds to generate the page from a database vs reading a file from disk.
The bigger advantage to static sites is portability (even though you can have a webapp that reads markdown files just as easily as database rows).
I run a Python script after the build has completed that reads the entire sitemap and chunks it into parts of 50k.
+1 for mentioning incremental builds as well. These two features are often overlooked and people just ask "why do you even have so many pages?" and it ends there because nobody wants to entertain the power user.
A third disadvantage I've seen is search. I use fuse to generate a JSON for client side search but it takes a lot of memory to render and is a cause for concern.
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.
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).
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.
(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).
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
[0]: https://wiki.musl-libc.org/functional-differences-from-glibc...
[1]: https://doc.rust-lang.org/edition-guide/rust-2018/platform-a...
Doesn't go or rust give you a static executable?
Regarding Ruby, Gems on Linux is a mess that I don't want to have to deal with for anything, but especially not for a static site generator.
Rust probably could provide a precompiled binary, but the recommended installation method for Blades involves `cargo` which is why I asked the question.
https://gohugo.io/getting-started/installing/#binary-cross-p...
Cargo is the Rust compiler (or rather the Rust build system). After you run it, it'll spit out a binary which you can use elsewhere. If I'm reading your question correctly, this would be analogous to seeing a reference to CMake in a C++ project's README and then asking whether C++ supports precompiled binaries.
But a Python venv and a requirements lockfile can alleviate a lot of the issues you seemed to have.
Seems like placing the generator directly in the repo is a little bit of an overreaction. Maybe it is all you have time/patience for, but I would not consider it a clean practice. (E.g. it would break when you switch CPU architectures, which I have done since I started my site).
I understand sticking the generator in the repo isn't a good practice, but I really just want a simple setup that won't have dependency problems. Probably an executable shell or Python file that doesn't draw in any dependencies would be ideal for me since those can run on pretty much any Linux computer in my experience.
Based off the recommendations here, I'll likely migrate my Jekyll site to Hugo or this one which was recommended by another commenter in the thread: https://rgz.ee/ssg.html
Right now, do you just keep Hugo in your `$PATH`? If you do that, do you need to note in your site's README which version of Hugo it should be built with, or are Hugo versions pretty backwards-compatible with each other?
Use a self-contined binaries from random sources and goodbye security.
Thanks!
Documentation here: https://rgz.ee/ssg.html
unfortunately i don't see any license for that awk script, but still, just look at it!
I moved to it from Jekyll/Hugo, because I hate dealing with Ruby and dependencies like you!
Some of the other commenters have pointed out that Hugo also has standalone binaries, I just didn't notice them last time I looked. What made you choose Zola over Hugo?
Hugo definitely has more features. If you think you'll want to do some complex hierarchies in your blog/site, or want a lot of themes to pick from I'd go with Hugo.
Hopefully that helps!
Edit: I think Hugo used to require Pygments (a pip package), but it looks like that's no longer the case. If it did that probably nudged me towards Zola too.
Coupling it with Tailwind for styling meant that developing the theme was really smooth (slowest part of changing a template was waiting for the browser to refresh, i.e. < 1s).
Aside from my pedantry, it causes computers to make more unnecessary computations and our civilization emits more carbon. It also affects me because I currently have an old CPU and it takes a few seconds for syntax highlighting to kick in. Every time I press "Back" in my browser, syntax highlighting needs to be recalculated as well.
Oh well, on the bright side I have an itch to scratch :-).
I'd consider it an accessibility issue - hardcoding the syntax highlighting on the backend makes it more difficult for people to change using accessibility tools. Whereas with js-based highlighting, you can probably just change the theme and get readable output.
Mainly that JS highlighting normally works with a theme variable which is much easier to change to get, e.g., a high-contrast theme than having to muck about with 10-20 different CSS styles.
Ignoring that option, working with a known set of CSS styles in the DOM is going to be easier than dealing with John Q Random's own particular set for highlighting (assuming they haven't used the same as a popular JS highlighter, of course!)
(To my shame, whatever Hugo is now using for syntax highlighting makes an awful mess - everything is "style:color#123456", no semantic information - I'll be fixing that ASAP.)
vs
antipathy - negative / "hatred"
They are claiming that the rust team uses client side JS because they don't care about the negative implications of doing so.
Or simply from GitHub releases: https://github.com/grego/blades/releases
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.
CommonMark supports HTML tags, so one can currently also write pages in plain HTML if they want to.
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.