diff --git a/layouts/shortcodes/posts-2024.html b/layouts/shortcodes/posts-2024.html index 48279b5..c481a22 100644 --- a/layouts/shortcodes/posts-2024.html +++ b/layouts/shortcodes/posts-2024.html @@ -1,35 +1,31 @@ {{/* Define section to pull recent posts from */}} {{ $mainSections := site.Params.mainSections | default (slice "post") }} -{{ $show_recent_posts := site.Params.ananke.show_recent_posts }} {{/* First filter by section, then by year */}} {{ $filteredBySection := where site.RegularPages "Section" "in" $mainSections }} {{ $section := where $filteredBySection "Date.Year" 2024 }} {{ $section_count := len $section }} -
- {{ $n_posts := $.Param "recent_posts_number" | default 10 }} +{{/* Use .Page to access page parameters */}} +{{ $n_posts := .Page.Param "recent_posts_number" | default 3 }} -
- {{/* Range through the first $n_posts items of the section */}} - {{ range (first $n_posts $section) }} -
- {{ .Render "summary-with-image" }} -
+
+ {{ range (first $n_posts $section) }} +
+ {{ .Render "summary-with-image" }} +
+ {{ end }} +
+ +{{ if ge $section_count (add $n_posts 1) }} +
+

{{ i18n "more" }}

+ {{ range (first 4 (after $n_posts $section)) }} +

+ + {{ .Title }} + +

{{ end }}
- - {{ if ge $section_count (add $n_posts 1) }} -
-

{{ i18n "more" }}

- {{/* Now, range through the next four after the initial $n_posts items */}} - {{ range (first 4 (after $n_posts $section)) }} -

- - {{ .Title }} - -

- {{ end }} -
- {{ end }} -
\ No newline at end of file +{{ end }} \ No newline at end of file