Hugo 0.56.0 is filled with improvements, but there are two main headliners: Hugo Modules and Hugo Deploy .
Hugo Modules is very much a community effort on the design and specification side, but @bep has driven the implementation. Some notes about what all of this is about:
- A new
moduleconfiguration section where you can import almost anything. You can configure both your own file mounts and the file mounts of the modules you import. This is the new recommended way of configuring what you earlier put in
staticDiretc. And it also allows you to mount folders in non-Hugo-projects, e.g. the
SCSSfolder in the Bootstrap GitHub project.
- A module consists of a set of mounts to the standard 7 component types in Hugo:
archetypes. Yes, Theme Components can now include content, which should be very useful, especially in bigger multilingual projects.
- Modules not in your local file cache will be downloaded automatically and even “hot replaced” while the server is running.
- Hugo Modules supports and encourages semver versioned modules, and uses the minimal version selection algorithm to resolve versions.
- A new set of CLI commands are provided to manage all of this:
hugo mod init,
hugo mod get,
hugo mod graph,
hugo mod tidy, and
hugo mod vendor.
Hugo Modules is powered by Go Modules.
This is all very much brand new and there are only a few example projects around:
- GitHub - bep/docuapi: Beautiful multilingual API documentation theme for Hugo is a theme that has been ported to Hugo Modules while testing this feature. It is a good example of a non-Hugo-project mounted into Hugo’s folder structure. It even shows a JS Bundler implementation in regular Go templates.
- GitHub - bep/my-modular-site: Just a test site is a very simple site used for testing.
See the Hugo Modules Documentation for more information.
Well this is super exciting! Just as I’m deploying a bunch of Hugo sites, too! Time to deep dive on this, but I"m been waiting for modules, it’s gonna be cool!