Skip to content

Commit 66ec630

Browse files
authored
docs: Add 0.20.2 release notes
1 parent 1cf2920 commit 66ec630

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

docs/content/meta/release-notes.md

+46
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,52 @@ menu:
99
title: Release Notes
1010
weight: 10
1111
---
12+
# **0.20.2** April 16th 2017
13+
14+
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.
15+
16+
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.
17+
18+
A simple example:
19+
20+
In `layouts/partials/mystyles.css`:
21+
22+
```css
23+
body {
24+
background-color: {{ .Param "colors.main" }}
25+
}
26+
```
27+
28+
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):
29+
30+
```toml
31+
[params]
32+
[params.colors]
33+
main = "green"
34+
text = "blue"
35+
```
36+
37+
And then in `layouts/partials/head.html` (or the partial used to include the head section into your layout):
38+
39+
```html
40+
<head>
41+
<style type="text/css">
42+
{{ partial "mystyles.css" . | safeCSS }}
43+
</style>
44+
</head>
45+
```
46+
47+
Of course, `0.20` also made it super-easy to create external `CSS` stylesheets based on your site and page configuration. A simple example:
48+
49+
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:
50+
51+
```html
52+
{{ with .OutputFormats.Get "css" }}
53+
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
54+
{{ end }}`
55+
```
56+
57+
1258
# **0.20.1** April 13th 2017
1359
Hugo `0.20.1` is a bug fix release, fixing some important regressions introduced in `0.20` a couple of days ago:
1460

0 commit comments

Comments
 (0)