Change feeds titles to be similar to page titles
This commit is contained in:
@@ -17,18 +17,26 @@
|
||||
{{ $subpages = first $limit $subpages }}
|
||||
{{ end }}
|
||||
|
||||
{{ $titles := slice (markdownify $page.Title) }}
|
||||
{{ $titles := slice }}
|
||||
|
||||
{{ range .Ancestors }}
|
||||
{{ $titles = $titles | append (markdownify .Title) }}
|
||||
{{ if $page.IsHome }}
|
||||
{{ $titles = slice (site.Title | default $page.Title | markdownify | plainify | htmlUnescape) }}
|
||||
{{ else }}
|
||||
{{ with $page.Title }}
|
||||
{{ $titles = slice (. | markdownify | plainify | htmlUnescape) }}
|
||||
{{ end }}
|
||||
|
||||
{{ range .Ancestors }}
|
||||
{{ $title := cond .IsHome (site.Title | default .Title) .Title }}
|
||||
|
||||
{{ with $title }}
|
||||
{{ $titles = $titles | append (. | markdownify | plainify | htmlUnescape) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $title := delimit $titles " · " }}
|
||||
|
||||
{{ if not $title }}
|
||||
{{ warnf "layouts/_default/list.atom.xml: Page %s does not have a title. The atom output requires a title. Either set the page's title parameter, or disable the atom output." $page.RelPermalink }}
|
||||
{{ end }}
|
||||
|
||||
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\"?>" | safeHTML }}
|
||||
|
||||
<feed {{ with $language }} xml:lang="{{ . }}" {{ end }} xmlns="http://www.w3.org/2005/Atom">
|
||||
|
@@ -16,18 +16,26 @@
|
||||
{{ $subpages = $subpages | first $limit }}
|
||||
{{ end }}
|
||||
|
||||
{{ $titles := slice (markdownify $page.Title) }}
|
||||
{{ $titles := slice }}
|
||||
|
||||
{{ range .Ancestors }}
|
||||
{{ $titles = $titles | append (markdownify .Title) }}
|
||||
{{ if $page.IsHome }}
|
||||
{{ $titles = slice (site.Title | default $page.Title | markdownify | plainify | htmlUnescape) }}
|
||||
{{ else }}
|
||||
{{ with $page.Title }}
|
||||
{{ $titles = slice (. | markdownify | plainify | htmlUnescape) }}
|
||||
{{ end }}
|
||||
|
||||
{{ range .Ancestors }}
|
||||
{{ $title := cond .IsHome (site.Title | default .Title) .Title }}
|
||||
|
||||
{{ with $title }}
|
||||
{{ $titles = $titles | append (. | markdownify | plainify | htmlUnescape) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $title := delimit $titles " · " }}
|
||||
|
||||
{{ if not $title }}
|
||||
{{ warnf "layouts/_default/list.rss.xml: Page %s does not have a title. The rss output requires a title. Either set the page's title parameter, or disable the rss output." $page.RelPermalink }}
|
||||
{{ end }}
|
||||
|
||||
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\"?>" | safeHTML }}
|
||||
|
||||
<rss version="2.0" {{ with $language }} xml:lang="{{ . }}" {{ end }} xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
|
Reference in New Issue
Block a user