diff options
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/_default/list.feed.xml | 60 | ||||
| -rw-r--r-- | layouts/partials/alternate-outputs.html | 6 | ||||
| -rw-r--r-- | layouts/partials/head.html | 8 |
3 files changed, 6 insertions, 68 deletions
diff --git a/layouts/_default/list.feed.xml b/layouts/_default/list.feed.xml deleted file mode 100644 index c4be170..0000000 --- a/layouts/_default/list.feed.xml +++ /dev/null @@ -1,60 +0,0 @@ -{{- $pctx := . -}} -{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} - -{{- $pages := slice -}} -{{- if $.IsHome -}} - {{- $mainSections := site.Params.mainSections | default (slice "posts") }} - {{- $pages = where $pctx.RegularPages.ByDate.Reverse "Type" "in" $mainSections -}} -{{- else if $.IsSection -}} - {{- $pages = $pctx.RegularPages.ByDate.Reverse -}} -{{- else -}} - {{- $pages = $pctx.Pages -}} -{{- end -}} - -{{- $limit := site.Params.feedSize | default 25 -}} -{{- $pages = $pages | first $limit -}} - -{{- $siteLastMod := partial "site-last-mod.html" . -}} -{{- $siteAuthor := partial "site-author.html" . -}} - -{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }} -<rss version="2.0" - xmlns:content="http://purl.org/rss/1.0/modules/content/" - xmlns:wfw="http://wellformedweb.org/CommentAPI/" - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:atom="http://www.w3.org/2005/Atom" - xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" - xmlns:slash="http://purl.org/rss/1.0/modules/slash/" - xmlns:media="http://search.yahoo.com/mrss/" - xml:lang="{{ site.LanguageCode }}" - xml:base="{{ site.BaseURL }}"> - <channel> - <title>{{ partial "title.html" . }}</title> - <link>{{ .Permalink }}</link> - <description>{{ partial "description.html" . }}</description> - <generator>Hugo {{ hugo.Version }}</generator> - <language>{{ site.Language.LanguageCode }}</language>{{ with site.Params.Copyright -}} - {{ $copyright := replace . "{year}" now.Year }}{{ $copyright = replace $copyright "©" "©" }} - <copyright>{{ $copyright | plainify }}</copyright>{{ end }} - <lastBuildDate>{{ $siteLastMod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate> - {{- $output_formats := .OutputFormats }} - {{- range $output_formats -}} - {{- $rel := (or (and (eq "feed" (.Name | lower)) "self") "alternate") -}} - {{- with $output_formats.Get .Name }} - {{ printf `<atom:link href=%q rel=%q type=%q title=%q />` .RelPermalink $rel .MediaType.Type .Name | safeHTML }} - {{- end -}} - {{- end }} - {{- range $pages }} - <item> - <title>{{ .Title }}</title> - <link>{{ .Permalink | absURL }}?utm_source=rss_feed</link> - <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> - {{ with $siteAuthor.email }}<author>{{ . }}{{ with $siteAuthor.name }} ({{ . }}){{ end }}</author>{{ end }} - <category>{{ .Section }}</category>{{ range (.GetTerms "tags") }} - <category>{{ .LinkTitle }}</category>{{ end }} - <guid isPermaLink="false">{{ md5 .Permalink }}</guid> - <description>{{ .Summary | transform.XMLEscape | safeHTML }}</description> - </item> - {{ end }} - </channel> -</rss> diff --git a/layouts/partials/alternate-outputs.html b/layouts/partials/alternate-outputs.html deleted file mode 100644 index 52bdd0d..0000000 --- a/layouts/partials/alternate-outputs.html +++ /dev/null @@ -1,6 +0,0 @@ -{{- range .AlternativeOutputFormats }} - <link rel="{{ .Rel }}" type="{{ .MediaType.Type | html }}" href="{{ .RelPermalink | safeURL }}" title="{{ .Name }}"> -{{- end }} - <link rel="manifest" type="application/manifest+json" href="{{ "manifest.webmanifest" | relURL }}" title="Manifest"> - <link rel="sitemap" type="application/xml" href="{{ "sitemap.xml" | relURL }}" title="Sitemap"> - <link rel="author" type="text/plain" href="{{ "humans.txt" | relURL }}" title="Humans"> diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 5bf6e09..94684a2 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -18,8 +18,12 @@ <link rel="icon" href="{{ site.Params.assets.svgicon | default "icon.svg" | relURL }}" type="image/svg+xml"> <link rel="apple-touch-icon" href="{{ site.Params.assets.apple_touch_icon | default "apple-touch-icon.png" | relURL }}"><!-- 180×180 --> - {{- /* Feed, sitemap and manifest */}} - {{ partial "alternate-outputs.html" . }} + {{- range .AlternativeOutputFormats }} + <link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}" title="{{ .Name }}"> + {{- end }} + + <link rel="sitemap" type="application/xml" href="{{ "sitemap.xml" | relURL }}" title="Sitemap"> + <link rel="author" type="text/plain" href="{{ "humans.txt" | relURL }}" title="Humans"> {{- range .AllTranslations -}} <link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}"> |
