Skip to content
Permalink
Browse files

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.
  • Loading branch information...
davidsneighbour authored and bep committed Jun 1, 2019
1 parent 52211f6 commit 0a738467bf63b999a9ad14d68b00e36311c314d3
Showing with 1 addition and 7 deletions.
  1. +1 −7 content/en/templates/rss.md
@@ -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:

0 comments on commit 0a73846

Please sign in to comment.
You can’t perform that action at this time.