Change feeds titles to be similar to page titles
This commit is contained in:
@@ -17,18 +17,26 @@
|
|||||||
{{ $subpages = first $limit $subpages }}
|
{{ $subpages = first $limit $subpages }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ $titles := slice (markdownify $page.Title) }}
|
{{ $titles := slice }}
|
||||||
|
|
||||||
{{ range .Ancestors }}
|
{{ if $page.IsHome }}
|
||||||
{{ $titles = $titles | append (markdownify .Title) }}
|
{{ $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 }}
|
{{ end }}
|
||||||
|
|
||||||
{{ $title := delimit $titles " · " }}
|
{{ $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 }}
|
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\"?>" | safeHTML }}
|
||||||
|
|
||||||
<feed {{ with $language }} xml:lang="{{ . }}" {{ end }} xmlns="http://www.w3.org/2005/Atom">
|
<feed {{ with $language }} xml:lang="{{ . }}" {{ end }} xmlns="http://www.w3.org/2005/Atom">
|
||||||
|
@@ -16,18 +16,26 @@
|
|||||||
{{ $subpages = $subpages | first $limit }}
|
{{ $subpages = $subpages | first $limit }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ $titles := slice (markdownify $page.Title) }}
|
{{ $titles := slice }}
|
||||||
|
|
||||||
{{ range .Ancestors }}
|
{{ if $page.IsHome }}
|
||||||
{{ $titles = $titles | append (markdownify .Title) }}
|
{{ $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 }}
|
{{ end }}
|
||||||
|
|
||||||
{{ $title := delimit $titles " · " }}
|
{{ $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 }}
|
{{ 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">
|
<rss version="2.0" {{ with $language }} xml:lang="{{ . }}" {{ end }} xmlns:atom="http://www.w3.org/2005/Atom">
|
||||||
|
Reference in New Issue
Block a user