Finish RSS and Atom implementations
This commit is contained in:
parent
d971696e11
commit
256eae44e9
9 changed files with 118 additions and 0 deletions
18
layouts/index.rss
Normal file
18
layouts/index.rss
Normal file
|
@ -0,0 +1,18 @@
|
|||
{{- $pageContext := . -}}
|
||||
{{- if .IsHome -}}
|
||||
{{ $pageContext = .Site }}
|
||||
{{- end -}}
|
||||
|
||||
{{- $pages := slice -}}
|
||||
{{- if or $.IsHome $.IsSection -}}
|
||||
{{- $pages = $pageContext.RegularPages -}}
|
||||
{{- else -}}
|
||||
{{- $pages = $pageContext.Pages -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $limit := .Site.Config.Services.RSS.Limit -}}
|
||||
{{- if ge $limit 1 -}}
|
||||
{{- $pages = $pages | first $limit -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ partial "feeds/rss/base.xml" (dict "context" . "pages" $pages "Site" .Site) }}
|
Loading…
Add table
Add a link
Reference in a new issue