Releases: gohugoio/hugo
v0.45.1
v0.45
Hugo 0.45
is the revival of ref, relref and GetPage. @vassudanagunta and @bep have done some great work improving the API and implementation for the helper functions used to get one page. Before this release, the API was a little bit clumsy and the result potentially ambiguous in some situations.
Now you can simply do:
{{ with .Site.GetPage "/blog/my-post.md" }}{{ .Title }}{{ end }}
Or to get a section page:
{{ with .Site.GetPage "/blog" }}{{ .Title }}{{ end }}
We have also added a .GetPage
method on Page
and added support for page-relative linking. This means that the leading slash (/
) now has a meaning. For .Site.GetPage
, all lookups will start at the content root. But for lookups with a Page
context, paths without a leading slash will be treated as relative to the page.
This means that the following example will find the page in the current section:
{{< ref "my-post.md" >}}
You can also use the ..
to refer to a page one level up etc.:
{{< ref "../my-post.md" >}}
We have now also added language support to ref
and relref
, so you can link to a page in another language:
{{< relref path="document.md" lang="jp" >}}
To link to a given Output Format of a document, you can use this syntax:
{{< relref path="document.md" outputFormat="rss" >}}
To make working with these reflinks on bigger sites easier to work with, we have also improved the error logging, and added two new configuration settings:
- refLinksErrorLevel: ERROR (default, will fail the build when a reflink cannot be resolved) or WARNING.
- refLinksNotFoundURL: Set this to an URL placeholder used when no reference could be resolved.
Visit the Hugo Docs for more information.
We have also done some important improvements and fixes in Hugo Pipes in this release: SCSS source maps on Windows now works, we now support project-local PostCSS
installation, and we have added IncludePaths
to SCSS
options, making it possible to include, say, a path below node_modules
in the SASS/SCSS build.
This release represents 31 contributions by 4 contributors to the main Hugo code base.
@bep leads the Hugo development with a significant amount of contributions, but also a big shoutout to @vassudanagunta, @hairmare, and @garrmcnu for their ongoing contributions.
And a big thanks to @digitalcraftsman for his 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 10 contributions by 8 contributors. A special thanks to @kaushalmodi, @Hanzei, @KurtTrowbridge, and @regisphilibert for their work on the documentation site.
Hugo now has:
- 27334+ stars
- 443+ contributors
- 238+ themes
Notes
.Site.GetPage
with more than 2 arguments will not work anymore. This means that{{ .Site.GetPage "page" "blog" "my-post.md" }}
will fail.{{ .Site.GetPage "page" "blog/my-post.md" }}
will work, but we recommend you use the simpler{{ .Site.GetPage "/blog/my-post.md" }}
- Relative paths in
relref
orref
that finds its match not relative to the page itself will work, but we now print a warning saying that you should correct it to an absolute path. E.g.{{</* ref "blog/my-post.md" */>}}
=>{{</* ref "/blog/my-post.md" */>}}
.
Enhancements
- Print a WARNING about relative non-relative ref/relref matches a451c49f @bep #4973
- Allow untyped nil to be merged in lang.Merge ff16c42e @bep #4977
- Get rid of the utils package 062510cf @bep
- Update hugo_windows.go 4e1d0cd9 @bep
- Add IncludePaths config option 166483fe @bep #4921
- Increase refLinker test coverage 8278384b @vassudanagunta
- Add test coverage for recent ref overhaul 2bac3715 @vassudanagunta #4969
- Update ref, relref, GetPage docs 1eb8b36b @bep
- Document refLinksErrorLevel and refLinksNotFoundURL 00c74ee7 @bep #4964
- Add configurable ref/relref error handling and notFoundURL e25aa655 @bep #4964
- Try node_modules/postcss-cli/bin/postcss first ebe4d39f @bep #4952
- Add optional lang as argument to rel/relref d741064b @bep #4956
- Simplify .Site.GetPage etc. 3eb313fe @bep #4147#4727#4728#4728#4726#4652
- Unify page lookups b93417aa @vassudanagunta #4147#4727#4728#4728#4726#4652
- Improve error message 4c240800 @bep
- Remove unused code 2f2bc7ff @bep
Fixes
- Avoid server panic on TOML mistake in i18n 75acff5f @bep #4942
- Only set 'allThemes' if there are themes in the config file 38204c4a @garrmcnu #4851
- Fix potential server panic with drafts/future enabled 1ab4658c @bep #4965
- Mark shortcode changes as content changes in server mode 12679b40 @bep #4965
- Fix source maps on Windows f01505c9 @bep #4968
- Fix typo-logic bug in GetPage b56d9a12 @vassudanagunta
- Enable test case fixed by commit 501543d d6fde8fa @vassudanagunta
- Fix theme config for Work Fs 5c9d5413 @bep #4951
- Fix addkit link to account for i18n fd1f4a78 @hairmare
Automated with GoReleaser
Built with go version go1.10.1...
v0.44
Hugo 0.44
is the follow-up release, or The Sequel, of the very well received 0.43
only days ago. That release added Hugo Pipes, with SCSS/SASS support, assets bundling and minification, ad-hoc image processing and much more.
This is mostly a bug-fix release, but it also includes several important improvements.
Many complained that their SVG images vanished when browsed from the hugo server
. With Hugo Pipes MIME types suddenly got really important, but Hugo's use of Suffix
was ambiguous. This became visible when we redefined the image/svg+xml
to work with Hugo Pipes. We have now added a Suffixes
field on the MIME type definition in Hugo, which is a list of one or more filename suffixes the MIME type is identified with. If you need to add a custom MIME type definition, this means that you also need to specify the full MIME type as the key, e.g. image/svg+xml
.
Hugo now has:
- 27120+ stars
- 443+ contributors
- 239+ themes
Notes
MediaType.Suffix
is deprecated and replaced with a plural version,MediaType.Suffixes
, with a more specific definition. You will get a detailed WARNING in the console if you need to do anything.
Enhancements
- Allow multiple file suffixes per media type b874a1ba @bep #4920
- Clean up the in-memory Resource reader usage 47d38628 @bep #4936
- Move opening of the transformed resources after cache check 0024dcfe @bep
- Improve type support in
resources.Concat
306573de @bep #4934 - Flush
partialCached
cache on rebuilds 6b6dcb44 @bep #4931 - Include the transformation step in the error message d96f2a46 @bep #4924
- Exclude *.svg from CRLF/LF conversion 9c1e8208 @anthonyfok
Fixes
- Fix
resources.Concat
for transformed resources beec1fc9 @bep #4936 - Fix static filesystem for themed multihost sites 80c8f3b8 @bep #4929
- Set permission of embedded templates to 0644 2b73e89d @anthonyfok
Automated with GoReleaser
Built with go version go1.10.1 linux/amd64
v0.43
Windows users, see #4919
Hugo 0.43
adds a powerful and very simple to use Assets Pipeline with SASS and SCSS with source map support, PostCSS and minification and fingerprinting and Subresource Integrity and ... much more. Oh, did we mention that you can now do ad-hoc image processing and execute text resources as Go templates?
An example pipeline:
{{ $styles := resources.Get "scss/main.scss" | toCSS | postCSS | minify | fingerprint }}
<link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}" media="screen">
To me, the above is beautiful in its speed and simplicity. It could be printed on a t-shirt. I wrote in the Hugo Birthday Post some days ago about the value of a single binary with native and fast implementations. I should have added simplicity as a keyword. There seem to be a misconception that all of this needs to be hard and painful.
New functions to create Resource
objects:
resources.Get
resources.FromString
: Create a Resource from a string.
New Resource
transformation funcs:
resources.ToCSS
: CompileSCSS
orSASS
intoCSS
.resources.PostCSS
: Process your CSS with PostCSS. Config file support (project or theme or passed as an option).resources.Minify
: Currently supportscss
,js
,json
,html
,svg
,xml
.resources.Fingerprint
: Creates a fingerprinted version of the given Resource with Subresource Integrity.resources.Concat
: Concatenates a list of Resource objects. Think of this as a poor man's bundler.resources.ExecuteAsTemplate
: Parses and executes the given Resource and data context (e.g. .Site) as a Go template.
I, @bep, implemented this in dea71670. We will work hard to get the documentation up to date, but follow the links above for details, and also see this demo project.
This release represents 35 contributions by 7 contributors to the main Hugo code base.
@bep leads the Hugo development with a significant amount of contributions, but also a big shoutout to @anthonyfok, @openscript, and @caarlos0 for their ongoing contributions.
And a big thanks to @digitalcraftsman for his 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 11 contributions by 5 contributors. A special thanks to @bep, @danrl, @regisphilibert, and @digitalcraftsman for their work on the documentation site.
Hugo now has:
- 26968+ stars
- 443+ contributors
- 238+ themes
Notes
- Replace deprecated {Get,}ByPrefix with {Get,}Match 42ed6025 @anthonyfok
- Hugo is now released with two binary version: One with and one without SCSS/SASS support. At the time of writing, this is only available in the binaries on the GitHub release page. Brew, Snap builds etc. will come. But note that you only need the extended version if you want to edit SCSS. For your CI server, or if you don't use SCSS, you will most likely want the non-extended version.
Enhancements
Templates
- Return en empty slice in
after
instead of error f8212d20 @bep #4894 - Update internal pagination template to support Bootstrap 4 ca1e46ef @bep #4881
- Support text/template/parse API change in go1.11 9f27091e @anthonyfok #4784
Core
- Allow forward slash in shortcode names de37455e @bep #4886
- Reset the global pages cache on server rebuilds 128f14ef @bep #4845
Other
- Bump CircleCI image e3df6478 @bep
- Add Goreleaser extended config 626afc98 @bep #4908
- Build both hugo and hugo.extended for 0.43 e1027c58 @anthonyfok #4908
- Add temporary build script bfc3488b @bep
- Add "extended" to "hugo version" ce84b524 @anthonyfok #4913
- Add a newScratch template func 2b8d907a @bep #4685
- Add Hugo Piper with SCSS support and much more dea71670 @bep #4381#4903#4858
- Consider root and current section's content type if set in front matter c790029e @bep #4891
- Update docker image 554553c0 @bep
- Merge branch 'release-0.42.2' 282f6035 @bep
- Release 0.42.2 1637d12e @bep
- Update GoReleaser config 1f0c4e1f @caarlos0
- Create missing head.html partial on new theme generation fd71fa89 @openscript
- Add html doctype to baseof.html template for new themes b5a3aa70 @openscript
- Adds .gitattributes to force Go files to LF 6a2968fd @neurocline
- Update to Go 1.9.7 and Go 1.10.3 23d5fc82 @anthonyfok
- Update Dockerfile to a multi-stage build 8531ec7c @skoblenick #4154
- Release 0.42.1 d67e843c @bep
- Do not fail server build when /static is missing 34ee27a7 @bep #4846
Fixes
v0.42.2
v0.42.1
v0.42
Hugo 0.42
adds Theme Components. This is a really powerful new way of building your Hugo sites with reusable components. This is both Theme Composition and Theme Inheritance.
Read more about Theme Components in the Hugo Documentation.
The feature above was implemented by @bep, the funny Norwegian, with great design help from the Hugo community. But that implementation would not have been possible without Afero, Steve Francia's virtual file system. Hugo is built on top of Afero and many other fast and solid Go projects, and if you look at the combined contribution log of the Hugo project and its many open source dependencies, the total amount of contributions is staggering. A big thank you to them all!
This release represents 27 contributions by 7 contributors to the main Hugo code base. @bep leads the Hugo development with a significant amount of contributions, but also a big shoutout to @onedrawingperday, @anthonyfok, and @stefanneuhaus for their ongoing contributions.
And a big thanks to @digitalcraftsman for his 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 8 contributions by 5 contributors. A special thanks to @bep, @LorenzCK, @gavinwray, and @deyton for their work on the documentation site.
Hugo now has:
- 26286+ stars
- 444+ contributors
- 235+ themes
Notes
- The
speakerdeck
shortcode is removed. It didn't work properly, so is isn't expected to be in wide use. If you use it, you will get a build error. You will either have to remove its usage or add aspeakerdeck
shortcode to your own project or theme. - We have now virtualized the filesystems for project and theme files. This makes everything simpler, faster and more powerful. But it also means that template lookups on the form
{{ template “theme/partials/pagination.html” . }}
will not work anymore. That syntax has never been documented, so it's not expected to be in wide use.{{ partial "pagination.html" . }}
will give you the most specific version of that partial.
Enhancements
- Always load GA script over HTTPS 2e6712e2 @coliff
- Remove speakerdeck shortcode 65deb72d @onedrawingperday #4830
- Add
strings.RuneCount
019bd557 @theory - Add
strings.Repeat
13435a6f @theory - Reset Page's main output on server rebuilds dc4226a8 @bep #4819
- Create LICENSE rather than LICENSE.md in "new theme" ed4a345e @anthonyfok #4623
- Create
_default/baseof.html
in "new theme" 9717ac7d @anthonyfok #3576 - Add
tweet_simple
shortcode 07b96d16 @onedrawingperday - Make "new theme" feedback more intuitive 692ec008 @anthonyfok
- Move nextStepsText() to new_site.go d3dd74fd @anthonyfok
- Add support for theme composition and inheritance 80230f26 @bep #4460#4450
- Add vimeo_simple 8de53244 @onedrawingperday #4749
- Add a BlackFriday option for rel="noreferrer" on external links 20cbc2c7 @stefanneuhaus #4722
- Add a BlackFriday option for rel="nofollow" on external links 7a619264 @stefanneuhaus #4722
- Update Chroma b5b36e32 @bep #4779
- Enhance Page and Resource String() 4f0665f4 @vassudanagunta
- Update theme documentation c74b0f8f @bep #4460
Fixes
- Make sure that
.Site.Taxonomies
is always set on rebuilds 6464981a @bep #4838 - Reset the "distinct error logger" on rebuilds bf5f10fa @bep #4818
- Remove frameborder attr YT iframe + CSS fixes ceaff7ca @onedrawingperday
- Fix vimeo_simple thumb scaling b84389c5 @onedrawingperday
- Fix typo instagram_simple d68367cb @onedrawingperday
- Prevent isBaseTemplate() from matching "baseof" in dir c3115292 @anthonyfok #4809
Automated with GoReleaser
Built with go version go1.10.1 linux/amd64
v0.41
In Hugo 0.41
we add a new Privacy Configuration section to meet the new regulations in the new General Data Protection Regulation (GDPR). Many have contributed work on this project, but a special thanks to @onedrawingperday, @jhabdas, and @it-gro.
You can read more about the new Privacy Config here.
Hugo now has:
- 25917+ stars
- 446+ contributors
- 231+ themes
Notes
- We have fixed an issue where we sent the wrong
.Site
object into the archetype templates used inhugo new
. This meant that if you wanted to access site params and some other fields you needed to use.Site.Info.Params
etc. This release fixes that so now you can use the same construct in the archetype templates as in the regular templates.
Enhancements
- Alias tweet shortode to twitter 3bfe8f4b @bep #4765
- Adjust GA templates f45b522e @bep #4616
- Wrap the relevant templates with the privacy policy disable check 67892073 @bep #4616
- Extract internal templates 34ad9a4f @bep #4457
- Use double quotes instead of back quotes b2b500f5 @anthonyfok
- Provide the correct .Site object to archetype templates ab02594e @bep #4732
- Document the GDPR Privacy Config c71f201f @bep #4751
- Add no-cookie variants of the Google Analytics templates [a51945e] (a51945e) @bep #4775
- Remove youtube_simple for now 448081b8 @bep #4751
- Add anonymizeIP to GA privacy config 1f1d955b @bep #4751
- Support DNT in Twitter shortcode for GDPR 9753cb59 @bep #4765
- Regenerate embedded templates 6aa2c385 @bep #4761
- Add instagram_simple shortcode 9ad46a20 @bep #4748
- Go fmt 4256de33 @bep
- Remove the id from youtube_simple bed7a0fa @bep #4751
- Add an unified .Site.Config with a services section 4ddcf52c @bep #4751
- Move the privacy config into a parent 353148c2 @bep #4751
- Make the simple mode YouTube links schemaless 69ee6b41 @bep #4616
- Add YouTube shortcode simple mode 88e35686 @bep #4616
- Do not return error on .Get "class" and vice versa in shortcodes 2f17f937 @bep #4745
- Create SUPPORT.md 0a7027e2 @coliff
- Add PrivacyEnhanced mode for YouTube to the GDPR Policy 5f24a2c0 @bep #4616
- Add RespectDoNotTrack to GDPR privacy policy for Google Analytics 71014201 @bep #4616
- Add the foundation for GDPR privacy configuration 0bbdef98 @bep #4616
- Show site build warning in TestPageBundlerSiteRegular 9bd4236e @anthonyfok #4672
- Do not show empty BuildDate in version 4eedb377 @anthonyfok
- Improve markup determination logic 2fb9af59 @vassudanagunta
- Update CONTRIBUTING.md b6ededf0 @domdomegg
Fixes
Automated with GoReleaser
Built with go version go1.10.1 linux/amd64
v0.40.3
Hugo 0.40.3
fixes a possible .Content
truncation issue introduced in 0.40.1
90d0d830 @bep #4706. This should be very rare. It has been reported by only one user on a synthetic site. We have tested a number of big sites that does not show this problem with 0.40.2
, but this is serious enough to warrant a patch release.
Automated with GoReleaser
Built with go version go1.10.1 linux/amd64
v0.40.2
This release fixes some regressions introduced in Hugo 0.40
. See the milestone for an issue list.
- Reset .Page.Scratch on live-reload 655983a2 @bep #4683
- Fix .WordCount, .FuzzyWordCount, .ReadingTime when summary marker is set 001a28c2 @bep #4675#4682
Automated with GoReleaser
Built with go version go1.10.1 linux/amd64