logoalt Hacker News

eloisantlast Sunday at 2:37 PM4 repliesview on HN

Is there any static site generator where you specify the version you use, and the launcher will simply run the old binary that you want?

Like most build systems work, for example when you set a "rust-version" in Cargo.toml and only bump it when you explicitely want to. This way it will still use the older version on a fresh checkout.


Replies

Cyph0nlast Sunday at 6:45 PM

Just wrap it in a Nix flake and define a devshell. The entire config won’t exceed more than ~10 lines of Nix.

Once setup, all you need to do is:

    $ nix develop —-command hugo regenerate
    $ # version is pinned by flake.lock
The beauty of this approach is that it extends to almost any CLI tool you can think of :)
show 1 reply
brycewraylast Sunday at 7:40 PM

> Is there any static site generator where you specify the version you use, and the launcher will simply run the old binary that you want?

For Hugo, there is Hugo Version Manager (hvm)[0], a project maintained by Hugo contributor Joe Mooring. While the way it works isn't precisely what you described, it may come close enough.

[0]: https://github.com/jmooring/hvm

show 1 reply
embedding-shapelast Sunday at 2:41 PM

I guess my very own "niccup" (basically hiccup-in-nix) fits that (https://embedding-shapes.github.io/niccup/), as you'll typically always include the library together with a strictly set version, so even when new versions are available, you'd need to explicitly upgrade if you want it.

arjielast Sunday at 8:31 PM

I use `mise` to manage all my tool versions[0] and committing the version file to the repo is sufficient for later use. https://mise.jdx.dev/

0: not all, I use cargo to manage the rust toolchain