1

Correction du flux RSS

This commit is contained in:
2026-04-03 11:32:51 +02:00
parent dda4d07b03
commit 4cca3165b7
3 changed files with 25 additions and 6 deletions

View 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 -}}