mirror of
https://github.com/gohugoio/hugo.git
synced 2025-05-04 17:40:13 +03:00
doc: Merge commit '2c0d1ccdcd
'
This commit is contained in:
commit
f387cb1b38
146 changed files with 1037 additions and 1443 deletions
|
@ -22,19 +22,19 @@ It should not be used for HTML from a third-party, or HTML with unclosed tags or
|
|||
|
||||
Given a site-wide [`config.toml`][config] with the following `copyright` value:
|
||||
|
||||
```toml
|
||||
```
|
||||
copyright = "© 2015 Jane Doe. <a href=\"http://creativecommons.org/licenses/by/4.0/\">Some rights reserved</a>."
|
||||
```
|
||||
|
||||
`{{ .Site.Copyright | safeHTML }}` in a template would then output:
|
||||
|
||||
```html
|
||||
```
|
||||
© 2015 Jane Doe. <a href="http://creativecommons.org/licenses/by/4.0/">Some rights reserved</a>.
|
||||
```
|
||||
|
||||
However, without the `safeHTML` function, html/template assumes `.Site.Copyright` to be unsafe and therefore escapes all HTML tags and renders the whole string as plain text:
|
||||
|
||||
```html
|
||||
```
|
||||
<p>© 2015 Jane Doe. <a href="http://creativecommons.org/licenses by/4.0/">Some rights reserved</a>.</p>
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue