Hugo 0.15
The v0.15.0 Hugo release brings a lot of polish to Hugo. Exactly 6 months after the 0.14 release, Hugo has seen massive growth and changes. Most notably, this is Hugo’s first release under the Apache 2.0 license. With this license change we hope to expand the great community around Hugo and make it easier for our many users to contribute. This release represents over 377 contributions by 87 contributors to the main Hugo repo and hundreds of improvements to the libraries Hugo uses. Hugo also launched a new theme showcase and participated in Hacktoberfest.
Hugo now has:
- 6700 (+2700) stars on GitHub
- 235 (+75) contributors
- 65 (+30) themes
Template Improvements: This release takes Hugo to a new level of speed and usability. Considerable work has been done adding features and performance to the template system which now has full support of Ace, Amber and Go Templates.
Hugo Import: Have a Jekyll site, but dreaming of porting it to Hugo? This release introduces a new hugo import jekyllcommand that makes this easier than ever.
Performance Improvements: Just when you thought Hugo couldn’t get any faster, Hugo continues to improve in speed while adding features. Notably Hugo 0.15 introduces the ability to render and serve directly from memory resulting in 30%+ lower render times.
Huge thanks to all who participated in this release. A special thanks to @bep who led the development of Hugo this release again, @anthonyfok, @eparis, @tatsushid and @DigitalCraftsman.
New features
- new
hugo import jekyllcommand. #1469 - The new
Paramconvenience method onPageandNodecan be used to get the most specific parameter value for a given key. #1462 - Several new information elements have been added to
PageandNode:RuneCount: The number of runes in the content, excluding any whitespace. This may be a good alternative to.WordCountfor Japanese and other CJK languages where a word-split by spaces makes no sense. #1266RawContent: Raw Markdown as a string. One use case may be of embedding remarkjs.com slides.IsHome: tells the truth about whether you’re on the home page or not.
Improvements
hugo servernow builds ~30%+ faster by rendering to memory instead of disk. To get the old behavior, start the server with--renderToDisk=true.- Hugo now supports dynamic reloading of the config file when watching.
- We now use a custom-built
LazyFileReaderfor reading file contents, which means we don’t read media files in/contentinto memory anymore – and file reading is now performed in parallel on multicore PCs. #1181 - Hugo is now built with
Go 1.5which, among many other improvements, have fixed the last known data race in Hugo. #917 - Paginator now also supports page groups. #1274
- Markdown improvements:
Scratchnow has built-inmapsupport.- We now fall back to
link titlefor the default page sort. #1299 - Some notable new configuration options:
hugo gencan now generate man files, bash auto complete and markdown documentation- Hugo will now make suggestions when a command is mistyped
- Shortcodes now have a boolean
.IsNamedParamsproperty. #1597
New Template Features
- All template engines:
- The new
dictfunction that could be used to pass maps into a template. #1463 - The new
pluralizeandsingularizetemplate funcs. - The new
base64Decodeandbase64Encodetemplate funcs. - The
sorttemplate func now accepts field/key chaining arguments and pointer values. #1330 - Several fixes for
slicestrandsubstr, most importantly, they now have fullutf-8-support. #1190 #1333 #1347 - The new
lasttemplate function allows the user to select the lastNitems of a slice. #1148 - The new
afterfunc allows the user to select the items after theNthitem. #1200 - Add
time.Timetype support to thewhere,ge,gt,le, andlttemplate functions. - It is now possible to use constructs like
where Values ".Param.key" nilto filter pages that doesn’t have a particular parameter. #1232 getJSON/getCSV: Add retry on invalid content. #1166- The new
readDirfunc lists local files. #1204 - The new
safeJSfunction allows the embedding of content into JavaScript contexts in Go templates. - Get the main site RSS link from any page by accessing the
.Site.RSSLinkproperty. #1566
- The new
- Ace templates:
- Full support for Amber templates including all template functions.
- A built-in template for Google Analytics. #1505
- Hugo is now shipped with new built-in shortcodes: #1576
youtubefor YouTube videosvimeofor Vimeo videosgistfor GitHub giststweetfor Twitter Tweetsspeakerdeckfor Speakerdeck slides
Bugfixes
- Fix data races in page sorting and page reversal. These operations are now also cached. #1293
page.HasMenuCurrent()andnode.HasMenuCurrent()now work correctly in multi-level nested menus.- Support
Fish and Chipsstyle section titles. Previously, this would end up asFish And Chips. Now, the first character is made to upper, but the rest are preserved as-is. #1176 - Hugo now removes superfluous p-tags around shortcodes. #1148
Notices
hugo serverwill watch by default now.- Some fields and methods were deprecated in
0.14. These are now removed, so the error message isn’t as friendly if you still use the old values. So please change:getJsontogetJSON,getCsvtogetCSV,safeHtmltosafeHTML,safeCsstosafeCSS,safeUrltosafeURL,UrltoURL,UrlPathtoURLPath,BaseUrltoBaseURL,RecenttoPages.
Known Issues
Using the Hugo v0.15 32-bit Windows or ARM binary, running hugo server would crash or hang due to a memory alignment issue in Afero. The bug was discovered shortly after the v0.15.0 release and has since been fixed by @tpng. If you encounter this bug, you may either compile Hugo v0.16-DEV from source, or use the following solution/workaround:
- 64-bit Windows users: Please use hugo_0.15_windows_amd64.zip (amd64 == x86-64). It is only the 32-bit hugo_0.15_windows_386.zip that crashes/hangs (see #1621 and #1628).
- 32-bit Windows and ARM users: Please run
hugo server --renderToDiskas a workaround until Hugo v0.16 is released (see “hugo server” returns runtime error on armhf and #1716).
Improve this page