summaryrefslogtreecommitdiff
path: root/layouts/partials/list
diff options
context:
space:
mode:
authorArne Rief <riearn@proton.me>2026-01-09 12:24:05 +0100
committerArne Rief <riearn@proton.me>2026-01-09 12:24:05 +0100
commitf8541ef965ca22e746b523eb418e47cb4f78f2d8 (patch)
tree49e1540ed42595a44196817eadf97337587a2aea /layouts/partials/list
parent038054b8206a9c25e84adeb0f0f355abd22d6143 (diff)
Upgrade to new template system from Hugo v0.146.0
Diffstat (limited to 'layouts/partials/list')
-rw-r--r--layouts/partials/list/pagination.html28
-rw-r--r--layouts/partials/list/post-card.html66
-rw-r--r--layouts/partials/list/recent-posts.html45
3 files changed, 0 insertions, 139 deletions
diff --git a/layouts/partials/list/pagination.html b/layouts/partials/list/pagination.html
deleted file mode 100644
index dfe8178..0000000
--- a/layouts/partials/list/pagination.html
+++ /dev/null
@@ -1,28 +0,0 @@
-{{- $paginator := . }}
-{{- if gt $paginator.TotalPages 1 }}
-<nav class="pagination" aria-label="{{ lang.Translate "page_navigation" | default "Page navigation" }}">
- {{- if $paginator.HasPrev }}
- <a href="{{ $paginator.Prev.URL }}"
- class="pagination__link"
- rel="prev"
- aria-label="{{ lang.Translate "page_previous" | default "Previous page" }}"
- >
- &larr; {{ lang.Translate "previous" | default "Previous" }}
- </a>
- {{- end }}
-
- <p class="pagination__current">
- {{ lang.Translate "page_position" $paginator.PageNumber $paginator.TotalPages | default (printf "Page %d of %d" $paginator.PageNumber $paginator.TotalPages) }}
- </p>
-
- {{- if $paginator.HasNext }}
- <a href="{{ $paginator.Next.URL }}"
- class="pagination__link"
- rel="next"
- aria-label="{{ lang.Translate "page_next" | default "Next page" }}"
- >
- {{ lang.Translate "next" | default "Next" }} &rarr;
- </a>
- {{- end }}
-</nav>
-{{- end }}
diff --git a/layouts/partials/list/post-card.html b/layouts/partials/list/post-card.html
deleted file mode 100644
index 6444701..0000000
--- a/layouts/partials/list/post-card.html
+++ /dev/null
@@ -1,66 +0,0 @@
-{{- /*
-Card with a summary of and link to a post. Accepts a dict with the following parameters:
-
-@context {Page} post: The post to display.
-@context {bool} show_section: Whether to display a badge with the name of the section the post was published under (default: false).
-
-@example: {{ partial "list/post-card.html" (dict "post" . "show_section" true) }}
-*/ -}}
-
-{{- $post := .post -}}
-{{- $showSection := .show_section | default false -}}
-<article class="post-card">
- <header class="post-card__header">
- <h3 class="post-card__title">
- <a href="{{ $post.RelPermalink }}" class="post-card__link">
- {{ $post.Title }}
- </a>
- </h3>
- <div class="post-card__meta">
- <time datetime="{{ $post.Date.Format "2006-01-02T15:04:05Z07:00" }}" class="post-card__publish-date">
- {{ $post.Date | time.Format ":date_medium" }}
- </time>
- <!-- Uncomment for post meta info
- <p class="post-card__meta-info">
- <span class="post-card__reading-time">
- • {{ lang.Translate "reading_time" $post.ReadingTime | default (printf "Estimated reading time: %s min" $post.ReadingTime) }}
- </span>
- |
- <span class="post-card__word-count">
- {{ lang.Translate "word_count" $post.WordCount | default (printf "%s words" $post.WordCount) }} •
- </span>
- </p>
- -->
- {{- if $showSection }}
- <span class="post-card__section-badge">
- {{ lang.Translate ($post.Section | singularize) | default ($post.Section | singularize | title) }}
- </span>
- {{- end }}
- </div>
- </header>
-
- {{- with $post.Summary }}
- <div class="post-card__summary">
- {{ . }}
- </div>
- {{- end }}
-
- {{- with $post.Params.tags }}
- <footer class="post-card__tags">
- <ul class="post-card__tags-list">
- {{- range first 3 . }}
- <li class="post-card__tags-item">
- #{{ . }}
- </li>
- {{- end }}
- {{- if gt (len .) 3 }}
- <li class="post-card__tags-item post-card__tags-more">
- <span class="post-card__tags-more-count">
- +{{ sub (len .) 3 }} {{ lang.Translate "more" | default "more" }}
- </span>
- </li>
- {{- end }}
- </ul>
- </footer>
- {{- end }}
-</article>
diff --git a/layouts/partials/list/recent-posts.html b/layouts/partials/list/recent-posts.html
deleted file mode 100644
index 464e9f7..0000000
--- a/layouts/partials/list/recent-posts.html
+++ /dev/null
@@ -1,45 +0,0 @@
-{{- /*
-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").
-@context {bool} show_view_all: Whether to show "View All Posts" link (default: true).
-
-@example: {{ partial "list/recent-posts.html" (dict "count" 20 "title" "Latest updates" "show_view_all" true) }}
-*/ -}}
-
-{{- $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">
- {{ $title }}
- </h2>
- </header>
-
- {{- $recentPosts := where site.RegularPages "Params.excludeFromLists" "!=" true | first $count }}
- {{- if $recentPosts }}
- <div class="recent-posts__content">
- <ul class="recent-posts__list" role="list">
- {{- range $recentPosts }}
- <li class="recent-posts__list-item">
- {{- partial "list/post-card.html" (dict "post" . "show_section" true) }}
- </li>
- {{- end }}
- </ul>
-
- {{- if $showViewAll }}
- {{- with site.GetPage "/all-posts"}}
- <a href="{{ .RelPermalink }}" class="recent-posts__view-all-link">
- {{ lang.Translate "posts_all_view" | default "View all posts" }} »
- </a>
- {{- end }}
- {{- end }}
- </div>
- {{ else }}
- <p class="recent-posts__empty-message">
- {{ lang.Translate "list_empty" | default "No posts in this section." }}
- </p>
- {{- end }}
-</section>