Skip to content

Commit

Permalink
theme(fix): shorten 100posts hook
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsneighbour committed Oct 10, 2024
1 parent d029a4a commit 1ecb516
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions layouts/partials/hooks/post-after.html
Original file line number Diff line number Diff line change
@@ -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 -}}
<div data-nosnippet class="alert alert-dark mb-3" role="alert">
<p class="alert-heading d-flex flex-column flex-md-row
Expand Down

0 comments on commit 1ecb516

Please sign in to comment.