layouts/news/news-feed.html
{{ .Params.description }}
{{ $.Scratch.Set "categories" (slice ) }} {{ $.Scratch.Set "noCategories" 0 }} {{ $pages := (where .Site.Pages "Section" "news").ByPublishDate.Reverse }} {{ $sections := .Sections }} {{ range $sections }} {{ if and ( eq ( printf "%T" .Params.data_category ) "string" ) ( eq ( printf "%T" .LinkTitle ) "string" ) }} {{ if ( not ( in ($.Scratch.Get "categories") (delimit (slice .Params.data_category .LinkTitle ) "," ))) }} {{ $.Scratch.Add "categories" (delimit (slice .Params.data_category .LinkTitle ) ",") }} {{ end }} {{ end }} {{ end }} {{ range $.Scratch.Get "categories" }} {{ index (split . ",") 1 }} {{ end }}
{{ range $item := $pages }} {{with $item.PublishDate}} {{ range $a := $sections }} {{ if $a.IsAncestor $item }} [
{{ ($item.Params.publishdate).Format "Jan 2, 2006" }}
{{ $item.Params.description }}
{{ if $item.Params.cves }} CVE(s): {{ range $i, $cve := $item.Params.cves }} {{ . }} {{ if ne $i (sub (len $item.Params.cves ) 1) }} , {{ end }} {{ end }} {{ end }} {{ if $item.Params.cvss }} CVSS : {{ with $item.Params.cvss }} {{ . }} {{ end }} {{ end }} {{ if $item.Params.releases }} Affected versions : {{ range $i, $cve := $item.Params.releases }} {{ . }} {{ if ne $i (sub (len $item.Params.releases ) 1) }}, {{ end }} {{ end }} {{ end }}
{{ $a.LinkTitle }}
]({{%20$item.RelPermalink%20}}) {{ end }} {{ end }} {{ end }} {{ end }}