Refine rss build logic (#545)
* Add refine rss build logic * Switch to .RelPermalink since URL is deprecated
This commit is contained in:
parent
711d4c7749
commit
e151dad461
1 changed files with 5 additions and 3 deletions
|
@ -1,10 +1,12 @@
|
|||
{{- $pctx := . -}}
|
||||
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
|
||||
{{- $pages := slice -}}
|
||||
{{- if or $.IsHome $.IsSection -}}
|
||||
{{- if $.IsHome -}}
|
||||
{{- $pages = $pctx.RegularPages -}}
|
||||
{{- else if $.IsSection -}}
|
||||
{{- $pages = $pctx.RegularPagesRecursive -}}
|
||||
{{- else -}}
|
||||
{{- $pages = $pctx.Pages -}}
|
||||
{{- $pages = $pctx.RegularPagesRecursive -}}
|
||||
{{- end -}}
|
||||
{{- $limit := .Site.Config.Services.RSS.Limit -}}
|
||||
{{- if ge $limit 1 -}}
|
||||
|
@ -26,7 +28,7 @@
|
|||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||
{{- end -}}
|
||||
{{ range $pages }}
|
||||
{{- if ne .URL "search" -}}
|
||||
{{- if ne .RelPermalink "/search/" -}}
|
||||
<item>
|
||||
<title>{{ .Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue