chore(deps): upgrade tailwind to v4 via vite plugin
Replace @astrojs/tailwind with @tailwindcss/vite in the Astro config and lockfile to adopt Tailwind CSS v4 and simplify the build setup. Also update Markdown site content with current SpaghetAI/MarvinBlade infrastructure details.
This commit is contained in:
1 parent
ac545c4668
commit
3fef5d378e
26 files changed
+1822
-3548
No files matched your search
@@ -0,0 +1,43 @@
|
||||
// src/lib/content.ts
|
||||
import type { CollectionEntry } from "astro:content"
|
||||
import type { SearchEntry } from "@lib/types"
|
||||
|
||||
/**
|
||||
* Structural shape of anything the glob loader hands back for a dated
|
||||
* collection. Deliberately narrower than CollectionEntry<"blog"> so the
|
||||
* comparator can be unit tested without Astro's virtual module.
|
||||
*/
|
||||
interface DatedEntry {
|
||||
id: string
|
||||
data: { date: Date }
|
||||
}
|
||||
|
||||
/**
|
||||
* The glob loader returns entries in filename order, never by frontmatter
|
||||
* date, so every listing page must opt into date ordering explicitly.
|
||||
* Equal dates fall back to id to keep the order deterministic across builds
|
||||
* (two projects share 2025-08-01).
|
||||
*/
|
||||
export function byDateDesc(a: DatedEntry, b: DatedEntry): number {
|
||||
const diff = b.data.date.getTime() - a.data.date.getTime()
|
||||
return diff !== 0 ? diff : a.id.localeCompare(b.id)
|
||||
}
|
||||
|
||||
/**
|
||||
* Map a blog or project content entry down to the slim, serializable shape
|
||||
* used by ArrowCard and the search index. Centralising this keeps every page
|
||||
* (home, blog, projects, search) emitting identical card props.
|
||||
*/
|
||||
export function toSearchEntry(
|
||||
entry: CollectionEntry<"blog"> | CollectionEntry<"projects">
|
||||
): SearchEntry {
|
||||
return {
|
||||
id: entry.id,
|
||||
slug: entry.id,
|
||||
collection: entry.collection as "blog" | "projects",
|
||||
title: entry.data.title,
|
||||
summary: entry.data.summary,
|
||||
tags: entry.data.tags,
|
||||
date: entry.data.date.toISOString(),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user