Hugo 0.16
Hugo 0.16 is our best and biggest release ever. The Hugo community has outdone itself with continued performance improvements, beautiful themes for all types of sites from project sites to documentation to blogs to portfolios, and increased stability.
This release represents over 550 contributions by over 110 contributors to the main Hugo code base. Since last release Hugo has gained 3500 stars, 90 contributors and 23 additional themes.
This release celebrates 3 years since @spf13 wrote the first lines of Hugo. During those 3 years Hugo has accomplished some major milestones including…
- 10,000+ stars on GitHub
- 320+ contributors
- 90+ themes
- 1000s of happy websites
- Many subprojects like @spf13/cobra , @spf13/viper and @spf13/afero which have experienced broad usage across the Go ecosystem.
@bep led the development of Hugo for the 3rd consecutive release with nearly half of the contributions to 0.16 in addition to his considerable contributions as lead maintainer. @anthonyfok , @DigitalCraftsman , @MooreReason all made significant contributions. A special thanks to @abourget for his considerable work on multilingual support. Due to its broad impact we wanted to spend more time testing it and it will be included in Hugo’s next release.
Highlights
Partial Builds: Prior to this release Hugo would always reread and rebuild
the entire site. This release introduces support for reactive site building
while watching (hugo server
). Hugo will watch the filesystem for changes and
only re-read the changed files. Depending on the files change Hugo will
intelligently re-render only the needed portion of the site. Performance gains
depend on the operation performed and size of the site. In our testing build
times decreased anywhere from 10% to 99%.
Template Improvements: Template improvements continue to be a mainstay of each Hugo release. Hugo 0.16 adds support for the new block
keyword introduced in Go 1.6 – think base templates with default sections – as well as many new template functions.
Polish: As Hugo matures releases will inevitably contain fewer huge new features. This release represents hundreds of small improvements across ever facet of Hugo which will make for a much better experience for all of our users. Worth mentioning here is the curious bug where live reloading didn’t work in some editors on OS X, including the popular TextMate 2. This is now fixed. Oh, and now any error will exit with an error code, a big thing for automated deployments.
New Features
- Support reading configuration variables from the OS environment #2090
- Add emoji support #1892
- Add
themesDir
option to configuration #1556 - Add support for Go 1.6
block
keyword in templates #1832 - Partial static sync #1644
- Source file based relative linking (à la GitHub) 0f6b33
- Add
ByLastmod
sort function to pages. eb627c - New templates functions:
Enhancements
- Hugo now exits with error code on any error. This is a big thing for automated deployments. #740
- Print error when
/index.html
is zero-length #947 - Enable dirname and filename bash autocompletion for more flags 666ddd
- Improve error handling in commands #1502
- Add sanity checks for
hugo import jekyll
#1625 - Add description to
Page.Params
#1484 - Add async version of Google Analytics internal template #1711
- Add autostart option to YouTube shortcode #1784
- Set Date and Lastmod for main home page #1903
- Allow URL with extension in front matter #1923
- Add list support in Scratch eaba04
- Add file option to gist shortcode #1955
- Add config layout and content directory CLI options #1698
- Add boolean value comparison to
where
template function f3c74c - Do not write to cache when
ignoreCache
is set #2067 - Add option to disable rendering of 404 page #2037
- Mercurial is no longer needed to build Hugo #2062
- Do not create
robots.txt
by default #2049 - Disable syntax guessing for PygmentsCodeFences by default. To enable syntax
guessing again, add the following to your config file:
PygmentsCodeFencesGuessSyntax = true
#2034 - Make
ByCount
sort consistently #1930 - Add
Scratch
to shortcode #2000 - Add support for symbolic links for content, layout, static, theme #1855
- Add ‘+’ as one of the valid characters in URLs specified in the front matter #1290
- Make alias redirect output URLs relative when
RelativeURLs = true
#2093 - Hugo injects meta generator tag on homepage if missing #2182
Fixes
- Fix file change watcher for TextMate 2 and friends on OS X #1053
- Make dynamic reloading of config file reliable on all platform #1684
- Hugo now works on Linux/arm64 #1772
plainIDAnchors
now defaults totrue
#2057- Win32 and ARM builds fixed #1716
- Copy static dir files without theme’s static dir #1656
- Make
noTimes
command flag work #1657 - Change most global CLI flags into local ones #1624
- Remove transformation of menu URLs #1239
- Do not fail on unknown Jekyll file #1705
- Use absolute path when editing with editor #1589
- Fix hugo server “Watching for changes” path display #1721
- Do not strip special characters out of URLs #1292
- Fix
RSSLink
when uglyURLs are enabled #175 - Get BaseURL from viper in server mode #1821
- Fix shortcode handling in RST #1904
- Use default sitemap configuration for homepage #1304
- Exit if specific port is unavailable in server mode #1901
- Fix regression in “section menus for lazy blogger” #2065
0.15.0 November 25, 2015
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 jekyll
command 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 jekyll
command. #1469 - The new
Param
convenience method onPage
andNode
can be used to get the most specific parameter value for a given key. #1462 - Several new information elements have been added to
Page
andNode
:RuneCount
: The number of runes in the content, excluding any whitespace. This may be a good alternative to.WordCount
for 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 server
now 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
LazyFileReader
for reading file contents, which means we don’t read media files in/content
into memory anymore – and file reading is now performed in parallel on multicore PCs. #1181 - Hugo is now built with
Go 1.5
which, among many other improvements, have fixed the last known data race in Hugo. #917 - Paginator now also supports page groups. #1274
- Markdown improvements:
Scratch
now has built-inmap
support.- We now fall back to
link title
for the default page sort. #1299 - Some notable new configuration options:
hugo gen
can 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
.IsNamedParams
property. #1597
New Template Features
- All template engines:
- The new
dict
function that could be used to pass maps into a template. #1463 - The new
pluralize
andsingularize
template funcs. - The new
base64Decode
andbase64Encode
template funcs. - The
sort
template func now accepts field/key chaining arguments and pointer values. #1330 - Several fixes for
slicestr
andsubstr
, most importantly, they now have fullutf-8
-support. #1190 #1333 #1347 - The new
last
template function allows the user to select the lastN
items of a slice. #1148 - The new
after
func allows the user to select the items after theNth
item. #1200 - Add
time.Time
type support to thewhere
,ge
,gt
,le
, andlt
template functions. - It is now possible to use constructs like
where Values ".Param.key" nil
to filter pages that doesn’t have a particular parameter. #1232 getJSON
/getCSV
: Add retry on invalid content. #1166- The new
readDir
func lists local files. #1204 - The new
safeJS
function allows the embedding of content into JavaScript contexts in Go templates. - Get the main site RSS link from any page by accessing the
.Site.RSSLink
property. #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
youtube
for YouTube videosvimeo
for Vimeo videosgist
for GitHub giststweet
for Twitter Tweetsspeakerdeck
for 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 Chips
style section titles. Previously, this would end up asFish And Chips
. Now, the first character is made toupper, but the rest are preserved as-is. #1176 - Hugo now removes superfluous p-tags around shortcodes. #1148
Notices
hugo server
will 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:getJson
togetJSON
,getCsv
togetCSV
,safeHtml
tosafeHTML
,safeCss
tosafeCSS
,safeUrl
tosafeURL
,Url
toURL
,UrlPath
toURLPath
,BaseUrl
toBaseURL
,Recent
toPages
.
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 --renderToDisk
as a workaround until Hugo v0.16 is released (see “hugo server” returns runtime error on armhf and #1716 ).
Улучшить эту страницу