mirror of
https://github.com/gohugoio/hugo.git
synced 2026-09-02 11:42:37 +00:00
Adding required XML tag to sample templates
Since Hugo 0.55.0 the XML declaration on XML and RSS files is not added automatically anymore. The samples should reflect that.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
52211f6565
commit
0a738467bf
@@ -58,6 +58,7 @@ copyright = "This work is licensed under a Creative Commons Attribution-ShareAli
|
||||
This is the default RSS template that ships with Hugo. It adheres to the [RSS 2.0 Specification][RSS 2.0].
|
||||
|
||||
```xml
|
||||
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||
@@ -86,13 +87,6 @@ This is the default RSS template that ships with Hugo. It adheres to the [RSS 2.
|
||||
</rss>
|
||||
```
|
||||
|
||||
{{% warning "XML Header" %}}
|
||||
Hugo will automatically add the following header line to this file on render. Please do *not* include this in the template as it's not valid HTML.
|
||||
```
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
```
|
||||
{{% /warning %}}
|
||||
|
||||
## Reference your RSS Feed in `<head>`
|
||||
|
||||
In your `header.html` template, you can specify your RSS feed in your `<head></head>` tag using Hugo's [Output Formats][Output Formats] like this:
|
||||
|
||||
Reference in New Issue
Block a user