Skip to content

Commit

Permalink
fix: unescaped ampersand(&) in xml
Browse files Browse the repository at this point in the history
fixed #103
  • Loading branch information
reuixiy committed Apr 7, 2020
1 parent c4adfc5 commit b1890ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions layouts/index.sectionsatom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
{{- $pages = $pages | first $limit -}}
{{- end -}}
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ .Site.LanguageCode }}">
<title type="text">{{ .Site.Title | safeHTML }}</title>
<subtitle type="html">{{ .Site.Params.siteDescription | safeHTML }}</subtitle>
<title type="text">{{ .Site.Title }}</title>
<subtitle type="html">{{ .Site.Params.siteDescription }}</subtitle>
<updated>{{ now.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
<id>{{ .Permalink }}</id>
<link rel="alternate" type="text/html" href="{{ .Permalink }}" />
Expand All @@ -28,13 +28,13 @@
{{ with .Site.Copyright -}}
<rights>{{ . | plainify }}</rights>
{{- end }}
<generator uri="https://gohugo.io/" version="{{ printf "%s" hugo.Version | safeHTML }}">Hugo</generator>
<generator uri="https://gohugo.io/" version="{{ hugo.Version }}">Hugo</generator>
{{- range (where $pages "Section" "in" .Site.Params.mainSections) }}
{{ $page := . }}
{{- partial "utils/author.html" $page -}}
{{- $author := ($page.Scratch.Get "author") -}}
<entry>
<title type="text">{{ .Title | safeHTML }}</title>
<title type="text">{{ .Title }}</title>
<link rel="alternate" type="text/html" href="{{ .Permalink }}" />
<id>{{ .Permalink }}</id>
<updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
Expand Down
8 changes: 4 additions & 4 deletions layouts/index.sectionsrss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
{{- end }}
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title>{{ .Site.Title | safeHTML }}</title>
<title>{{ .Site.Title }}</title>
<link>{{ .Permalink }}</link>
<description>{{ .Site.Params.siteDescription | safeHTML }}</description>
{{ printf `<generator>Hugo %s https://gohugo.io/</generator>` hugo.Version | safeHTML }}
<description>{{ .Site.Params.siteDescription }}</description>
<generator>Hugo {{ hugo.Version }} https://gohugo.io/</generator>
{{ with .Site.LanguageCode }}
<language>{{ . }}</language>
{{ end }}
Expand All @@ -37,7 +37,7 @@
{{- partial "utils/author.html" $page -}}
{{- $author := ($page.Scratch.Get "author") -}}
<item>
<title>{{ .Title | safeHTML }}</title>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<guid isPermaLink="true">{{ .Permalink }}</guid>
<pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
Expand Down

0 comments on commit b1890ee

Please sign in to comment.