Hugo `0.20.2` adds support for plain text partials included into `HTML` templates. This was a side-effect of the big new [Custom Output Format](https://gohugo.io/extras/output-formats/) feature in `0.20`, and while the change was intentional and there was an ongoing discussion about fixing it in {{<gh3273>}}, it did break some themes. There were valid workarounds for these themes, but we might as well get it right.
The most obvious use case for this is inline `CSS` styles, which you now can do without having to name your partials with a `html` suffix.
A simple example:
In `layouts/partials/mystyles.css`:
```css
body {
background-color: {{ .Param "colors.main" }}
}
```
Then in `config.toml` (note that by using the `.Param` lookup func, we can override the color in a page's front matter if we want):
```toml
[params]
[params.colors]
main = "green"
text = "blue"
```
And then in `layouts/partials/head.html` (or the partial used to include the head section into your layout):
```html
<head>
<styletype="text/css">
{{ partial "mystyles.css" . | safeCSS }}
</style>
</head>
```
Of course, `0.20` also made it super-easy to create external `CSS` stylesheets based on your site and page configuration. A simple example:
Add "CSS" to your home page's `outputs` list, create the template `/layouts/index.css` using Go template syntax for the dynamic parts, and then include it into your `HTML` template with:
Hugo `0.20` introduces the powerful and long sought after feature [Custom Output Formats]({{< ref "extras/output-formats.md" >}}); Hugo isn't just that "static HTML with an added RSS feed" anymore. *Say hello* to calendars, e-book formats, Google AMP, and JSON search indexes, to name a few ({{<gh2828>}}).
This release represents **over 180 contributions by over 30 contributors** to the main Hugo code base. Since last release Hugo has **gained 1100 stars, 20 new contributors and 5 additional themes.**
Hugo now has:
- 16300+ stars
- 495+ contributors
- 156+ themes
{{<gh"@bep">}} still leads the Hugo development with his witty Norwegian humor, and once again contributed a significant amount of additions. Also a big shoutout to {{<gh"@digitalcraftsman">}} for his relentless work on keeping the documentation and the themes site in pristine condition, and {{<gh"@moorereason">}} and {{<gh"@bogem">}} for their ongoing contributions.
## Other Highlights
{{<gh"@bogem">}} has also contributed TOML as an alternative and much simpler format for language/i18n files ({{<gh3200>}}). A feature you will appreciate when you start to work on larger translations.
Also, there have been some important updates in the Emacs Org-mode handling: {{<gh"@chaseadamsio">}} has fixed the newline-handling ({{<gh3126>}}) and {{<gh"@clockoon">}} has added basic footnote support.
Worth mentioning is also the ongoing work that {{<gh"@rdwatters">}} and {{<gh"@budparr">}} is doing to re-do the [gohugo.io](https://gohugo.io/) site, including a total restructuring and partial rewrite of the documentation. It is getting close to finished, and it looks fantastic!
## Notes
*`RSS` description in the built-in template is changed from full `.Content` to `.Summary`. This is a somewhat breaking change, but is what most people expect from their RSS feeds. If you want full content, please provide your own RSS template.
* The deprecated `.RSSlink` is now removed. Use `.RSSLink`.
*`RSSUri` is deprecated and will be removed in a future Hugo version, replace it with an output format definition.
* The deprecated `.Site.GetParam` is now removed, use `.Site.Param`.
* Hugo does no longer append missing trailing slash to `baseURL` set as a command line parameter, making it consistent with how it behaves from site config. {{<gh3262>}}
## Enhancements
* Hugo `0.20` is built with Go 1.8.1.
* Add `.Site.Params.mainSections` that defaults to the section with the most pages. Plan is to get themes to use this instead of the hardcoded `blog` in `where` clauses. {{<gh3206>}}
* File extension is now configurable. {{<gh320>}}
* Impove `markdownify` template function performance. {{<gh3292>}}
* Add taxonomy terms' pages to `.Data.Pages` {{<gh2826>}}
* Change `RSS` description from full `.Content` to `.Summary`.
* Ignore "." dirs in `hugo --cleanDestinationDir` {{<gh3202>}}
* Allow `jekyll import` to accept both `2006-01-02` and `2006-1-2` date format {{<gh2738>}}
* Raise the default `rssLimit` {{<gh3145>}}
* Unify section list vs single template lookup order {{<gh3116>}}
* Allow `apply` to be used with the built-in Go template funcs `print`, `printf` and `println`. {{<gh3139>}}
## Fixes
* Fix deadlock in `getJSON` {{<gh3211>}}
* Make sure empty terms pages are created. {{<gh2977>}}
* Fix base template lookup order for sections {{<gh2995>}}
*`URL` fixes:
* Fix pagination URLs with `baseURL` with sub-root and `canonifyUrls=false` {{<gh1252>}}
* Fix pagination URL for resources with "." in name {{<gh2110>}} {{<gh2374>}} {{<gh1885>}}
* Handle taxonomy names with period {{<gh3169>}}
* Handle `uglyURLs` ambiguity in `Permalink` {{<gh3102>}}
* Fix `Permalink` for language-roots wrong when `uglyURLs` is `true` {{<gh3179>}}
* Fix misc case issues for `URLs` {{<gh1641>}}
* Fix for taxonomies URLs when `uglyUrls=true` {{<gh1989>}}
* Fix empty `RSSLink` for list pages with content page. {{<gh3131>}}
* Correctly identify regular pages on the form "my_index_page.md" {{<gh3234>}}
*`Exit -1` on `ERROR` in global logger {{<gh3239>}}
* Document hugo `help command` {{<gh2349>}}
* Fix internal `Hugo` version handling for bug fix releases. {{<gh3025>}}
* Only return `RSSLink` for pages that actually have a RSS feed. {{<gh1302>}}
We're happy to announce the first release of Hugo in 2017.
This release represents **over 180 contributions by over 50 contributors** to the main Hugo code base. Since last release Hugo has **gained 1450 stars, 35 new contributors and 15 additional themes.**
Hugo now has:
- 15200+ stars
- 470+ contributors
- 151+ themes
Furthermore, Hugo has its own Twitter account ([@gohugoio](https://twitter.com/gohugoio)) where we share bite-sized news and themes from the Hugo community.
{{<gh"@bep">}} leads the Hugo development and once again contributed a significant amount of additions. Also a big shoutout to {{<gh"@chaseadamsio">}} for the Emacs Org-mode support, {{<gh"@digitalcraftsman">}} for his relentless work on keeping the documentation and the themes site in pristine condition, {{<gh"@fj">}}for his work on revising the `params` handling in Hugo, and {{<gh"@moorereason">}} and {{<gh"@bogem">}} for their ongoing contributions.
Also, a considerably amount of work have been put into cleaning up the Hugo source code, in an issue titled [Refactor the globals out of site build](https://github.com/spf13/hugo/issues/2701). This is not immediately visible to the Hugo end user, but will speed up future development.
Hugo `0.18` was bringing full-parallel page rendering, so workarounds depending on rendering order did not work anymore, and pages with duplicate target paths (common examples would be `/index.md` or `/about/index.md`) would now conflict with the home page or the section listing.
With Hugo `0.19`, you can control this behaviour by turning off page types you do not want ({{<gh2534>}}). In its most extreme case, if you put the below setting in your `config.toml`, you will get **nothing!**:
* Enhance `.Param` to permit arbitrarily nested parameter references {{<gh2598>}}
* Use `Page.Params` more consistently when adding metadata {{<gh3033>}}
* The `sectionPagesMenu` feature ("Section menu for the lazy blogger") is now integrated with the section content pages. {{<gh2974>}}
* Hugo `0.19` is compiled with Go 1.8!
* Make template funcs like `findRE` and friends more liberal in what argument types they accept {{<gh3018>}} {{<gh2822>}}
* Improve generation of OpenGraph date tags {{<gh2979>}}
## Notes
*`sourceRelativeLinks` is now deprecated and will be removed in Hugo `0.21` if no one is stepping up to the plate and fixes and maintains this feature. {{<gh3028>}}
## Fixes
* Fix `.Site.LastChange` on sites where the default sort order is not chronological. {{<gh2909>}}
* Fix regression of `.Truncated` evaluation in manual summaries. {{<gh2989>}}
Hugo again continues its trend of each release being faster than the last. It's quite a challenge to consistently add significant new functionality and simultaneously dramatically improve performance. Running [this benchmark]( https://github.com/bep/hugo-benchmark) with [these sites](https://github.com/bep/hugo-benchmark/tree/master/sites) (renders to memory) shows about 60% reduction in time spent and 30% reduction in memory usage compared to Hugo 0.17.
## Other New Features
* Every `Page` now has a `Kind` property. Since everything is a `Page` now, the `Kind` is used to differentiate different kinds of pages.
Possible values are `page`, `home`, `section`, `taxonomy`, and `taxonomyTerm`.
(Internally, we also define `RSS`, `sitemap`, `robotsTXT`, and `404`, but those have no practical use for end users at the moment since they are not included in any collections.)
* Add a `GitInfo` object to `Page` if `enableGitInfo` is set. It then also sets `Lastmod` for the given `Page` to the author date provided by Git. {{<gh2291>}}
* Add `partialCached` template function {{<gh1368>}}
* Add shortcode to display Instagram images {{<gh2690>}}
* Add `noChmod` option to disable perm sync {{<gh2749>}}
* Add `quiet` build mode {{<gh1218>}}
## Notices
*`.Site.Pages` will now contain *several kinds of pages*, including regular pages, sections, taxonomies, and the home page.
If you want a specific kind of page, you can filter it with `where` and `Kind`.
`.Site.RegularPages` is a shortcut to the page collection you have been used to getting.
*`RSSlink` is now deprecated. Use `RSSLink` instead.
Note that in Hugo 0.17 both of them existed, so there is a fifty-fifty chance you will not have to do anything
(if you use a theme, the chance is close to 0), and `RSSlink` will still work for two Hugo versions.
## Fixes
* Revise the `base` template lookup logic so it now better matches the behavior of regular templates, making it easier to override the master templates from the theme {{<gh2783>}}
* Add workaround for `block` template crash.
Block templates are very useful, but there is a bug in Go 1.6 and 1.7 which makes the template rendering crash if you use the block template in more complex scenarios.
This is fixed in the upcoming Go 1.8, but Hugo adds a temporary workaround in Hugo 0.18. {{<gh2549>}}
* All the `Params` configurations are now case insensitive {{<gh1129>}} {{<gh2590>}} {{<gh2615>}}
* Make RawContent raw again {{<gh2601>}}
* Fix archetype title and date handling {{<gh2750>}}
* Fix TOML archetype parsing in `hugo new` {{<gh2745>}}
* Fix page sorting when weight is zero {{<gh2673>}}
* Fix page names that contain dot {{<gh2555>}}
* Fix RSS Title regression {{<gh2645>}}
* Handle ToC before handling shortcodes {{<gh2433>}}
* Only watch relevant themes dir {{<gh2602>}}
* Hugo new content creates TOML slices with closing bracket on new line {{<gh2800>}}
* Add page information to error logging in rendering {{<gh2570>}}
* Deprecate `RSSlink` in favor of `RSSLink`
* Make benchmark command more useful {{<gh2432>}}
* Consolidate the `Param` methods {{<gh2590>}}
* Allow to set cache dir in config file
* Performance improvements:
* Avoid repeated Viper loads of `sectionPagesMenu` {{<gh2728>}}
* Avoid reading from Viper for path and URL funcs {{<gh2495>}}
* Add `partialCached` template function. This can be a significant performance boost if you have complex partials that does not need to be rerendered for every page. {{<gh1368>}}
**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.
*`RuneCount`: The number of [runes](http://blog.golang.org/strings) 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. {{<gh1266>}}
* 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. {{<gh1181>}}
* Hugo is now built with `Go 1.5` which, among many other improvements, have fixed the last known data race in Hugo. {{<gh917>}}
* Paginator now also supports page groups. {{<gh1274>}}
* Hugo now supports GitHub-flavoured markdown code fences for highlighting for `md`-files (Blackfriday rendered markdown) and `mmark` files (MMark rendered markdown). {{<gh3621258>}}
*`IgnoreFiles` can be set with a list of Regular Expressions that matches files to be ignored during build. {{<gh1189>}}
*`PreserveTaxonomyNames`, when set to `true`, will preserve what you type as the taxonomy name both in the folders created and the taxonomy `key`, but it will be normalized for the URL. {{<gh1180>}}
* Support `Fish and Chips` style section titles. Previously, this would end up as `Fish And Chips`. Now, the first character is made toupper, but the rest are preserved as-is. {{<gh1176>}}
* Hugo now removes superfluous p-tags around shortcodes. {{<gh1148>}}
* 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` to `getJSON`, `getCsv` to `getCSV`, `safeHtml` to
`safeHTML`, `safeCss` to `safeCSS`, `safeUrl` to `safeURL`, `Url` to `URL`,
`UrlPath` to `URLPath`, `BaseUrl` to `BaseURL`, `Recent` to `Pages`.
Using the Hugo v0.15 32-bit Windows or ARM binary, running `hugo server` would crash or hang due to a [memory alignment issue](https://golang.org/pkg/sync/atomic/#pkg-note-BUG) in [Afero](https://github.com/spf13/afero). The bug was discovered shortly after the v0.15.0 release and has since been [fixed](https://github.com/spf13/afero/pull/23) by {{<gh"@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](https://github.com/spf13/hugo/releases/download/v0.15/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 {{<gh1621>}} and {{<gh1628>}}).
* **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](https://discuss.gohugo.io/t/hugo-server-returns-runtime-error-on-armhf/2293) and {{<gh1716>}}).