feat(quote-carousel): add QuoteCarouselBlock component and related types
Deploy / verify (push) Successful in 41s
Deploy / deploy (push) Successful in 1m1s

- Introduced a new QuoteCarouselBlock component for displaying rotating quotes.
- Added QuoteCarouselBlockData interface to define the structure of the quote carousel data.
- Updated existing components and types to integrate the new quote carousel functionality.
- Enhanced blog-utils to support filtering posts by tags more effectively.
- Made various UI improvements in the Footer and PostCard components for better user experience.
This commit is contained in:
Peter Meier
2026-04-18 13:19:59 +02:00
parent 3949df31bb
commit 597b920e7c
8 changed files with 285 additions and 52 deletions
+14 -12
View File
@@ -378,7 +378,19 @@ export async function resolvePostOverviewBlocks(
if (!Array.isArray(content)) continue;
for (const item of content) {
if (!isPostOverviewBlock(item)) continue;
if (item.allPosts) {
const rawFilter = item.filterByTag ?? [];
const tagSlugs = Array.isArray(rawFilter)
? rawFilter
.map((t) =>
typeof t === "string"
? t
: ((t as { _slug?: string })?._slug ?? ""),
)
.filter(Boolean)
: [];
const hasExplicitPosts = Array.isArray(item.posts) && item.posts.length > 0;
const useAllPosts = item.allPosts || (tagSlugs.length > 0 && !hasExplicitPosts);
if (useAllPosts) {
if (allPosts === null)
allPosts = await getPosts({
_sort: "created",
@@ -386,21 +398,11 @@ export async function resolvePostOverviewBlocks(
resolve: "all",
});
let list = filterHiddenPosts(sortPostsByDate(allPosts));
const rawFilter = item.filterByTag ?? [];
const tagSlugs = Array.isArray(rawFilter)
? rawFilter
.map((t) =>
typeof t === "string"
? t
: ((t as { _slug?: string })?._slug ?? ""),
)
.filter(Boolean)
: [];
if (tagSlugs.length) list = filterPostsByTagSlugs(list, tagSlugs);
const limit =
typeof item.numberItems === "number" ? item.numberItems : 9999;
item.postsResolved = list.slice(0, limit);
} else if (Array.isArray(item.posts) && item.posts.length > 0) {
} else if (hasExplicitPosts && Array.isArray(item.posts)) {
const first = item.posts[0];
const isResolved =
typeof first === "object" &&