hacky posts shortcode (needs love!)
This commit is contained in:
parent
ddffbf6e08
commit
86e895ad80
1 changed files with 16 additions and 0 deletions
16
layouts/shortcodes/posts-2025.html
Normal file
16
layouts/shortcodes/posts-2025.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" 2025 }}
|
||||||
|
|
||||||
|
{{/* 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