diff --git a/config/_default/params.toml b/config/_default/params.toml index d15943ef..02db652f 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -159,3 +159,7 @@ forgejoDefaultServer = "https://v8.next.forgejo.org" # bing = "" # pinterest = "" # yandex = "" + +[RSSNext] + # feedId = "" + # userId = "" diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index fc116a15..927b9fd4 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -155,3 +155,7 @@ smartTOCHideUnfocusedChildren = false # bing = "" # pinterest = "" # yandex = "" + +[RSSNext] + # feedId = "" + # userId = "" diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index eab24093..8a2faf00 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -1,16 +1,16 @@ {{- $pctx := . -}} -{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} -{{- $pages := slice -}} -{{- if or $.IsHome $.IsSection -}} -{{- $pages = $pctx.RegularPages -}} -{{- else -}} -{{- $pages = $pctx.Pages -}} -{{- end -}} -{{- $limit := .Site.Config.Services.RSS.Limit -}} -{{- if ge $limit 1 -}} -{{- $pages = $pages | first $limit -}} -{{- end -}} -{{- printf "" | safeHTML }} + {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} + {{- $pages := slice -}} + {{- if or $.IsHome $.IsSection -}} + {{- $pages = $pctx.RegularPages -}} + {{- else -}} + {{- $pages = $pctx.Pages -}} + {{- end -}} + {{- $limit := .Site.Config.Services.RSS.Limit -}} + {{- if ge $limit 1 -}} + {{- $pages = $pages | first $limit -}} + {{- end -}} + {{- printf "" | safeHTML }} {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} @@ -27,6 +27,12 @@ {{- with .OutputFormats.Get "RSS" -}} {{ printf "" .Permalink .MediaType | safeHTML }} {{- end -}} + {{ if and (.Site.Params.RSSNext.feedId) (.Site.Params.RSSNext.userId) }} + + {{ .Site.Params.RSSNext.feedId }} + {{ .Site.Params.RSSNext.userId }} + + {{ end }} {{ range $pages }} {{ .Title }} @@ -36,12 +42,12 @@ {{ .Permalink }} {{ .Summary | html }} {{ range ( where .Site.RegularPages ".RelPermalink" .RelPermalink | first 1 ) }} - {{- $images := .Resources.ByType "image" -}} - {{- $featured := $images.GetMatch "*feature*" -}} - {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} - {{- with $featured -}} - - {{- end -}} + {{- $images := .Resources.ByType "image" -}} + {{- $featured := $images.GetMatch "*feature*" -}} + {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} + {{- with $featured -}} + + {{- end -}} {{ end }} {{ end }}