https://gohugo.io/news/0.56.0-relnotes/
Hugo 0.56.0 is filled with improvements, but there are two main headliners: Hugo Modules and Hugo Deploy .
Hugo Deploy is implemented by @vangent and brings built-in deployment support for GCS, S3, or Azure using the Hugo CLI. See the Hugo Deploy Documentation for more information.
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
module
configuration 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 inconfigDir
,staticDir
etc. And it also allows you to mount folders in non-Hugo-projects, e.g. theSCSS
folder in the Bootstrap GitHub project.- A module consists of a set of mounts to the standard 7 component types in Hugo:
static
,content
,layouts
,data
,assets
,i18n
, andarchetypes
. 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
, andhugo 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!