diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-04-16 10:56:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-16 10:56:50 +0200 |
commit | 66ec6305f6cb450ddf9c489854146bac02f7dca1 (patch) | |
tree | 28c4b53ce5cda1e4c1bf6d44e9bb2513d81b8acb /docs | |
parent | 1cf29200b4bb0a9c006155ec76759b7f4b1ad925 (diff) |
docs: Add 0.20.2 release notes
Diffstat (limited to 'docs')
-rw-r--r-- | docs/content/meta/release-notes.md | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/docs/content/meta/release-notes.md b/docs/content/meta/release-notes.md index b86e3718d..af82d908a 100644 --- a/docs/content/meta/release-notes.md +++ b/docs/content/meta/release-notes.md @@ -9,6 +9,52 @@ menu: title: Release Notes weight: 10 --- +# **0.20.2** April 16th 2017 + +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 {{< gh 3273 >}}, 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> + <style type="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: + +```html +{{ with .OutputFormats.Get "css" }} +<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}"> +{{ end }}` +``` + + # **0.20.1** April 13th 2017 Hugo `0.20.1` is a bug fix release, fixing some important regressions introduced in `0.20` a couple of days ago: |