Hugo 0.56.0: Hugo Modules and Deployment
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:
- https://github.com/bep/docuapi 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.
- https://github.com/bep/my-modular-site is a very simple site used for testing.
See the Hugo Modules Documentation for more information.
This release represents 104 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 @vangent, @niklasfasching, and @coliff for their ongoing contributions. And a big thanks to @digitalcraftsman and @onedrawingperday for their relentless work on keeping the themes site in pristine condition and to @kaushalmodi for his great work on the documentation site.
Many have also been busy writing and fixing the documentation in hugoDocs, which has received 48 contributions by 37 contributors. A special thanks to @davidsneighbour, @bep, @BCNelson, and @coliff for their work on the documentation site.
Hugo now has:
- 36902+ stars
- 440+ contributors
- 328+ themes
Notes
We have removed the “auto theme namespacing” of params from theme configuration. This was an undocumented and hidden feature that wasn’t useful in practice.
We have revised and improved the symlinks support in Hugo: In earlier versions, symlinks were only fully supported for the content folders. With the introduction of the new very flexible file mounts, with content support even for what we have traditionally named “themes”, we needed a more precise definition of symlink support in Hugo:
- Symlinks are not supported outside of the main project ((the project you run
hugo
orhugo server
from). - In the main project
static
mounts, only symlinks to files are supported. - In all other mounts in the main project, both file and directory symlinks are allowed.
- Symlinks are not supported outside of the main project ((the project you run
Enhancements
Templates
- Add Merge function c624a779 @bep #5992
- Regenerate templates b2a3d464 @bep
- Unwrap any interface value in sort and where 8d898ad6 @bep #5989
- Convert numeric values to float64 and compare them fb007e9a @tryzniak #5685
- Provide more detailed errors in Where f76e5011 @moorereason
- Return error on invalid input in in 7fbfedf0 @bep #5875
- Make Pages etc. work with the in func 06f56fc9 @bep #5875
- Make Pages etc. work in uniq d7a67dcb @bep #5852
- Handle late transformation of templates 2957795f @bep #5865
Output
- Remove comma after URL in new site output de7b9475 @snorfalorpagus
Core
- Add a symdiff test 072aa7f1 @bep
- Add testfile to .gitignore 7611078d @bep
- Add another site benchmark dc1d4a92 @bep
- Prevent parallel server rebuilds 95ce2a40 @bep #5885#5968
- Disable racy test ad5703a9 @bep #5926
- Avoid recloning of shortcode templates 69a56420 @bep #5890
- No links for bundled pages 0775c98e @bep #5882
- Add some OutputFormats.Get tests 7aeeb60d @bep #5877
- Add some integration tests for in/uniq using Pages 6c80acbd @bep #5875#5852
- Add more tests for Permalinkable 35f41834 @bep #5849
- Add a test for parent’s resources in shortcode 8d7607ae @bep #5833
Other
- Add Hugo Modules docs 77bf2991 @bep
- Block symlink dir traversal for /static e5f22997 @bep
- modules: Gofmt 87a07282 @bep
- Rename disabled => disable in config 882d678b @bep
- Regenerate CLI docs 215d2ed8 @bep
- Regenerate data helpers 23adc0c2 @bep
- Add Hugo Modules 9f5a9207 @bep #5973#5996#6010#5911#5940#6074#6082#6092
- Tidy 47953148 @bep
- Update xerrors ac101aba @bep
- Ignore errors in go mod download 58a47ccd @bep
- Update Chroma 95b1d301 @bep #6088
- Change postcss to check for local installation under node_modules/.bin a5604e18 @ericselin #5091
- Add org to front matter formats 020086cb @niklasfasching
- Update go-org 8524baee @niklasfasching
- Pagination - do not render href if no next item 88c8a15b @markmandel
- Include path to source page in non-relative ref/relref warning 59c4bc52 @justinvp
- Update link to prevent redirect ff10aa52 @coliff
- Update URLs 9f258d2b @coliff
- Introduce ‘#+KEY[]:’ array notation fad183c4 @niklasfasching
- Replace goorgeous with go-org b6867bf8 @niklasfasching
- Default –target to the first deployment target 9df57154 @vangent
- Add safety barrier between concatenated javascript resources 35abce27 @vincent99
- Update CLI doc for “long” form 8914fe7e @vangent
- Drop dashes in http header matcher attributes; other changes from code review b0f536fb @vangent
- Add documentation for “hugo deploy” 1384d77a @vangent
- remove TODO comment about subfolders; handled by GoCDK blob URLs 5e83f425 @vangent
- Update gocloud.dev to v0.15.0. b376b268 @vangent
- Return nil when not found in resources.Get 4c560020 @bep #5999
- Update Viper d44d3ea8 @bep #5954
- Remove references to Google+ d1cf53f5 @brunoamaral
- Update gitmap to get CommitDate field 811ee996 @bep
- Create new ‘hugo list all’ command 5b4b8bb3 @rusnasonov #5904
- Medium -> Hugo exporting tool 2278b0eb @Ahirice
- Switch base image for final build 41974303 @brianredbeard #5970#5056
- Merge branch ‘release-0.55.6’ 6b3f1a10 @bep
- Release 0.55.6 9b48c5d6 @bep
- Update to Go 1.12.5 and Go 1.11.10 71b8d8b6 @bep #5944
- Support configuration of upload order 527cf1ab @vangent
- Support invalidating a CloudFront CDN cache f4956d9a @vangent
- Move the package below /langs 2838d58b @bep
- compute MD5 by reading if List didn’t provide one f330e869 @vangent
- Use proxy.golang.org 0091b1f8 @bep
- Add a “deploy” command c7165589 @vangent
- Release 0.55.5 e33ed29b @bep
- Regenerate docs helper cee181c3 @bep
- Update blackfriday to v1.5.2 1cbb501b @dbirks
- Release 0.55.4 1707f1a5 @bep
- Avoid rebuilding the Translations map for every lookup 4756ec3c @bep #5892
- Init mem profile at the end 4c3c5120 @bep
- Release 0.55.3 c85b726f @bep
- Regenerate docs helper 75b16e30 @bep
- Replace IsDraft with Draft in list command 3e421bd4 @bep #5873
- Release 0.55.2 fcd63a86 @bep
- Release 0.55.1 adb776b2 @bep
- Remove the space in
. RelPermalink
7966c0b5 @yihui
Fixes
Templates
- Fix slice type handling in sort e8a716b2 @bep #6023
- Fix internal templates usage of safeHTMLAttr e22b3f54 @rhcarvalho #5236#5246
- Fix nil compare in eq/ne for interface values 66b143a0 @bep #5905
- Fix hugo package name and add godocs 4f93f8c6 @moorereason
Output
- Fix permalink in sitemap etc. when multiple permalinkable output formats 6b76841b @bep #5910
- Fix links for non-HTML output formats c7dd66bf @bep #5877
- Fix menu URL when multiple permalinkable output formats ea529c84 @bep #5849
Core
- Fix broken test fa28df10 @bep
- Fix bundle path when slug is set 3e6cb2cb @bep #4870
- Fix PrevInSection/NextInSection for nested sections bcbed4eb @bep #5883
- Fix shortcode version=1 logic 33c73811 @bep #5831
- Fix Pages reinitialization on rebuilds 9b17cbb6 @bep #5833
- Fix shortcode namespace issue 56550d1e @bep #5863
- Fix false WARNINGs in lang prefix check 7881b096 @bep #5860
- Fix bundle resource publishing when multiple output formats 49d0a826 @bep #5858
- Fix panic for unused taxonomy content files b799b12f @bep #5847
- Fix dates for sections with dates in front matter 70148672 @bep #5854
- Fix simple menu config 9e9a1f92 @bep
Other
- Fix test on Windows e5b6e208 @bep
- Fix livereload for @import case 2fc0abd2 @bep #6106
- Fix typo s/Meny/Menu/ 90b0127f @kaushalmodi
- Add tests; fix Windows 5dc6d0df @vangent
- Fix concurrent initialization order 009076e5 @bep #5901
- Fix WeightedPages in union etc. f2795d4d @bep #5850
- Fix 4d425a86 @bep
- Fix paginator refresh on server change f7375c49 @bep #5838
- Fix .RSSLinke deprecation message 3b86b4a9 @bep #4427
Improve this page