Blog-Übersicht: Featured-Hero, Neu-Badge, Org-Sektion, Sortierung, konsolidiertes Suchfeld
- SearchField-Atom (src/lib/ui/SearchField.svelte, light/dark) in Kalender, Beiträge und globaler Suche einheitlich eingesetzt - Featured-Hero (neuester Beitrag groß, Seite 1 ungefiltert, nur bei "newest") - Neu-Badge in PostCard (Beitrag < 7 Tage) - Org-/BI-Tags (tag-org-*) in eigene Sektion; Tags ohne Beiträge ausgeblendet - Inline-Newsletter-CTA, prominenter RSS-Link - Sortierung Neueste/Älteste (Server-Param + URL-State, Toggle neben Pagination, Pagination trägt sort weiter) - Pagination als Pills (rounded-full) - Kalender: Tag-Filter einklappbar, Filterleiste mit Suche + Heute Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,16 +11,20 @@
|
||||
totalPages = 1,
|
||||
basePath = "/posts",
|
||||
activeTag = null,
|
||||
sort = "newest",
|
||||
}: {
|
||||
currentPage: number;
|
||||
totalPages: number;
|
||||
basePath?: string;
|
||||
activeTag?: string | null;
|
||||
sort?: "newest" | "oldest";
|
||||
} = $props();
|
||||
|
||||
const query = $derived(sort === "oldest" ? "?sort=oldest" : "");
|
||||
|
||||
function tagHref(tagSlug: string | null): string {
|
||||
if (!tagSlug) return `${basePath}/`;
|
||||
return `${basePath}/tag/${encodeURIComponent(tagSlug)}/`;
|
||||
if (!tagSlug) return `${basePath}/${query}`;
|
||||
return `${basePath}/tag/${encodeURIComponent(tagSlug)}/${query}`;
|
||||
}
|
||||
|
||||
function pageHref(page: number): string {
|
||||
@@ -28,7 +32,7 @@
|
||||
const tagPart = activeTag
|
||||
? `/tag/${encodeURIComponent(activeTag)}`
|
||||
: "";
|
||||
return `${basePath}${tagPart}/page/${page}/`;
|
||||
return `${basePath}${tagPart}/page/${page}/${query}`;
|
||||
}
|
||||
|
||||
const showPagination = $derived(totalPages > 1);
|
||||
@@ -46,7 +50,7 @@
|
||||
});
|
||||
|
||||
const baseShape =
|
||||
"rounded-xs h-8 mx-[2px] flex justify-center items-center no-underline text-sm font-medium border transition-colors";
|
||||
"rounded-full h-8 mx-[3px] flex justify-center items-center no-underline text-xs font-medium border transition-colors";
|
||||
const inactiveColors =
|
||||
"text-stein-700 border-stein-200 bg-white hover:bg-stein-50 hover:border-wald-300";
|
||||
const activeColors =
|
||||
|
||||
Reference in New Issue
Block a user