diff options
| author | Arne Rief <riearn@proton.me> | 2025-08-20 21:36:19 +0200 |
|---|---|---|
| committer | Arne Rief <riearn@proton.me> | 2025-08-20 21:36:19 +0200 |
| commit | dac4024abcfea76f14522a84bee4b7258c37b72d (patch) | |
| tree | 1aa3c2e0af122d5c0feb4360850476fd55d3831e /layouts/partials/list | |
| parent | f0506acd6f70da636b8fdb23439c85bbf2392b40 (diff) | |
Language selection & theme toggle
Diffstat (limited to 'layouts/partials/list')
| -rw-r--r-- | layouts/partials/list/recent-posts.html | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/layouts/partials/list/recent-posts.html b/layouts/partials/list/recent-posts.html index c1075e2..d774138 100644 --- a/layouts/partials/list/recent-posts.html +++ b/layouts/partials/list/recent-posts.html @@ -1,5 +1,5 @@ {{- /* -List of Recent Posts. Accepts a dict with the following optional parameters: +List of specified number of the most recent and published posts. Accepts a dict with the following optional parameters: @context {int} count: Number of posts to display (default: 10). @context {string} title: Section title (default: "Recent Articles"). @@ -11,7 +11,6 @@ List of Recent Posts. Accepts a dict with the following optional parameters: {{- $count := .count | default 10 -}} {{- $title := .title | default (lang.Translate "posts.recent" | default "Recent Articles") -}} {{- $showViewAll := .show_view_all | default true -}} - <section class="recent-posts" aria-labelledby="recent-posts-heading"> <header class="recent-posts__header"> <h2 id="recent-posts-heading" class="recent-posts__title"> @@ -19,7 +18,6 @@ List of Recent Posts. Accepts a dict with the following optional parameters: </h2> </header> - {{- /* Get published 10 most recent posts */ -}} {{- $recentPosts := where site.RegularPages "Date" "!=" nil }} {{- $recentPosts = where $recentPosts ".Date" "le" now }} {{- $recentPosts = first $count $recentPosts }} @@ -35,14 +33,14 @@ List of Recent Posts. Accepts a dict with the following optional parameters: </ul> {{- if $showViewAll }} - <a href="{{ with site.GetPage "/posts" }}{{ .RelPermalink }}{{ else }}/posts/{{ end }}" class="recent_posts__view-all-link"> + <a href="{{ with site.GetPage "/posts" }}{{ .RelPermalink }}{{ else }}/posts/{{ end }}" class="recent-posts__view-all-link"> {{ lang.Translate "posts.view_all" | default "View all posts" }} </a> {{- end }} </div> {{ else }} <div class="recent-posts__empty"> - <p class="recent_posts__empty-message"> + <p class="recent-posts__empty-message"> {{ lang.Translate "list.empty" | default "No posts in this section." }} </p> </div> |
