Install Hugo into your repository

Highly recommended if using npm for dependency management: hugo-installer by Dominique Müller.

Unlike hugo-bin, hugo-installer verifies the checksum & runs a health check when installing.

Hugo is one of the most popular static site generators. In the world of web development we usually choose npm as our dependency management solution. Hugo, however, is written in Go - and thus not integrated into the npm module ecosystem. Instead, users are asked to install Hugo globally on their systems. Suboptimal, really.

But don’t you worry, Hugo Installer is here to help! It’s a small Node.js script which you can use to fetch the correct Hugo binary for your system, e.g. via a postinstall hook within a package.json file. Neat!

Features include:

  • :computer: Compatible with all operating systems and system architectures (Windows, MacOS, Linux, …, CI/CD)
  • :star: Supports all Hugo versions, including extended version
  • :heart: Verifies checksum & runs health check when installing
  • :eyes: Recognizes already downloaded binaries
2 Likes

Good share. I’m interested in whether they have any plan to enjoy the power of Dependabot (to bump Hugo version, not its) and dart-sass.

How would dependabot know which Hugo to load? I don’t think it has THAT abilities. But maybe, as the binaries are installed in our own project via postinstall hook, it could just be solved by a parallel semver number for the hugo-installer project instead of 3.0.1

Specifically, I meant a default Hugo version the installer has. If the installer has that, update and publish it to npm continuously, Dependabot can detect the latest version of the installer including the latest Hugo version, and create a pull-request automatically. This is a reason I love to use the hugo-bin.

They could add a script that loads once daily (or more often) the Github API delivered release info and tadaah we have the latest version number. There are some very old version numbers in a JSON file in there already, so they might have had tried it before.

1 Like

I put a proposal forward on the repo. With proper automatic release management we would have fewer issues handing over finished projects to the end-users :slight_smile:

2 Likes