diff --git a/layouts/partials/hooks/post-after.html b/layouts/partials/hooks/post-after.html index 52faa5ce..2ff2b74f 100644 --- a/layouts/partials/hooks/post-after.html +++ b/layouts/partials/hooks/post-after.html @@ -1,12 +1,7 @@ {{ if collections.In .context.Params.tags "100DaysToOffload" }} - {{- $year := math.Sub now.Year 1 }} - {{- $month := now.Month -}} - {{- $day := now.Day -}} - {{- $startOfYear := time.AsTime (fmt.Printf "%04d-%02d-%02dT00:00:00" $year $month $day) -}} - {{- $tag100 := (collections.Index site.Taxonomies.tags "100daystooffload") -}} - {{- $allPosts := $tag100.Pages -}} - {{- $pages := collections.Where $allPosts "Date" "gt" $startOfYear -}} - {{- $amount := $pages | len -}} + {{- $startOfYear := time.AsTime (fmt.Printf "%04d-%02d-%02dT00:00:00" (math.Sub now.Year 1) now.Month now.Day) -}} + {{- $allPosts := (collections.Index site.Taxonomies.tags "100daystooffload").Pages -}} + {{- $amount := (collections.Where $allPosts "Date" "gt" $startOfYear) | len -}} {{- $rest := math.Sub 100 $amount -}}