This repository has been archived by the owner on Mar 8, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updating package hugo to release v0.75.0.
Release info
Hugo
0.75.0
brings several improvements to Hugo Modules, a new CLI command to bridge the JavaScript dependencies into Hugo, a refresh of the versions of the most important upstream dependencies, and more.NPM Pack
The new CLI command is called
hugo mod npm pack
. We have marked it as experimental. It works great, go ahead and use it, but we need to test this out in real projects to get a feel of it; it is likely that it will change/improve in the upcoming versions of Hugo. The command creates a consolidatedpackage.json
from the project and all of its theme components. On version conflicts, the version closest to the project is selected. We may revise that strategy in the future (minimal version selection maybe?), but this should give both control and the least amount of surprise for the site owner.So, why did we do this? JavaScript is often a background actor in a Hugo project, and it doesn't make sense to publish it to a NPM registry. The JS dependencies are mostly build tools (PostCSS, TailwindCSS, Babel),
devDependencies
. This has been working fine as long as you kept the JS config files (includingpackage.json
) in the project, adding duplication/work when using ready-to-use theme components. These tools work best when you have everything below a single file tree, which is very much different to how Hugo Modules work. An example of a module with TailwindCSS:If you included
tailwind-module
in a Hugo project and processed it withPostCSS
, this is what happened in earlier versions:postcss.config.js
lives as a starting point to look for anyrequire
'd dependency.PostCSS
was invoked (the project directory).The above just doesn't work and here is the technical notes on how we have fixed this:
hugo mod npm pack
creates a consolidatedpackage.json
based on files namedpackage.hugo.json
it finds in the dependency tree (one is created for you the first time you run this command). The end result will always bepackage.json
, which works seamlessly withnpm install
invoked automatically by Netlify and other CI vendors.node_modules
folder is added to NODE_PATH when runningPostCSS
andBabel
.assets/_jsconfig
where we, by default, mount the JS configuration files that we're interested in. This is where Hugo will start looking for these files, and the files' filenames will also be available in the Node environment, so you can do:Module Enhancements
noVendor
Glob pattern config to the module config d4611c43 @bep #7647. This allows you to only vendor a subset of your dependencies.ignoreImports
option to module imports config 20af9a07 @bep #7646, which allows you to import a module and load its config, but not follow its imports.--ignoreVendor
in favour of a--ignoreVendor
, a patch matching Glob pattern 9a1e6d15 @bep. A typical use for this would be when you have vendored your dependencies, but want to edit one of them.Statistics
This release represents 79 contributions by 19 contributors to the main Hugo code base. @bep leads the Hugo development with a significant amount of contributions, but also a big shoutout to @dependabot[bot], @moorereason, and @jmooring for their ongoing contributions.
And a big thanks to @digitalcraftsman for his relentless work on keeping the themes site in pristine condition and to @davidsneighbour, @coliff and @kaushalmodi for all the great work on the documentation site.
Many have also been busy writing and fixing the documentation in hugoDocs,
which has received 24 contributions by 15 contributors. A special thanks to @jmooring, @bep, @jornane, and @inwardmovement for their work on the documentation site.
Hugo now has:
Notes
We now build with Go 1.15, which means that we no longer build release binaries for MacOS 32-bit.
Enhancements
Templates
Output
Other
Fixes
Other