vorjahre seite, shortcode für 2024
This commit is contained in:
parent
f55c09d419
commit
b879eb37df
2 changed files with 25 additions and 5 deletions
16
layouts/shortcodes/posts-2024.html
Normal file
16
layouts/shortcodes/posts-2024.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
{{/* Get all posts from the posts section */}}
|
||||
{{ $postsSection := site.GetPage "section" "posts" }}
|
||||
{{ $currentYearPosts := where $postsSection.Pages "Date.Year" 2024 }}
|
||||
|
||||
{{/* Display the filtered posts */}}
|
||||
<aside class="flex-ns flex-wrap justify-around mt5">
|
||||
{{ range first 10 $currentYearPosts }} {{/* Show first 10 or remove 'first' for all */}}
|
||||
<div class="relative w-100 w-30-l mb4 bg-white">
|
||||
<article>
|
||||
<h3 class="f4"><a href="{{ .RelPermalink }}" class="link black dim">{{ .Title }}</a></h3>
|
||||
<time class="f6 gray">{{ .Date.Format "January 2, 2006" }}</time>
|
||||
<p class="f5 lh-copy">{{ .Summary }}</p>
|
||||
</article>
|
||||
</div>
|
||||
{{ end }}
|
||||
</aside>
|
Loading…
Add table
Add a link
Reference in a new issue