Correction du flux RSS
This commit is contained in:
17
layouts/partials/rss/pages.html
Normal file
17
layouts/partials/rss/pages.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{{- $pages := .pages | default (slice) -}}
|
||||
{{- $filtered := slice -}}
|
||||
|
||||
{{- range $page := $pages -}}
|
||||
{{- if isset $page.Params "date" -}}
|
||||
{{- $frontmatter := "" -}}
|
||||
{{- with $page.File -}}
|
||||
{{- $source := readFile (printf "content/%s" .Path) -}}
|
||||
{{- $frontmatter = delimit (findRE `(?s)^---\r?\n.*?\r?\n---` $source 1) "" -}}
|
||||
{{- end -}}
|
||||
{{- if gt (len (findRE `(?m)^date:\s*['"]?\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}['"]?\s*$` $frontmatter 1)) 0 -}}
|
||||
{{- $filtered = $filtered | append $page -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- return $filtered -}}
|
||||
Reference in New Issue
Block a user