@velastack/patterns 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ var le = Object.create, ue = Object.defineProperty, de = Object.getOwnPropertyDe
|
|
|
26
26
|
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
27
27
|
}), ye = {
|
|
28
28
|
name: "@velastack/patterns",
|
|
29
|
-
version: "0.1.
|
|
29
|
+
version: "0.1.3",
|
|
30
30
|
description: "Registry of VelaStack patterns: generators and modifications applied to SvelteKit projects by the VelaStack CLI.",
|
|
31
31
|
type: "module",
|
|
32
32
|
private: !1,
|
|
@@ -68,7 +68,7 @@ var le = Object.create, ue = Object.defineProperty, de = Object.getOwnPropertyDe
|
|
|
68
68
|
"prettier-plugin-svelte": "^4.1.1"
|
|
69
69
|
},
|
|
70
70
|
peerDependencies: {
|
|
71
|
-
"@velastack/kit": "
|
|
71
|
+
"@velastack/kit": ">=0.1.0 <1.0.0",
|
|
72
72
|
"@velastack/pocketbase": "^0.2.0",
|
|
73
73
|
"@velastack/pocketbase-codegen": "^0.1.0",
|
|
74
74
|
"cross-spawn": "^7.0.6",
|
|
@@ -95,7 +95,7 @@ var le = Object.create, ue = Object.defineProperty, de = Object.getOwnPropertyDe
|
|
|
95
95
|
"@types/cross-spawn": "^6.0.6",
|
|
96
96
|
"@types/node": "^22.0.0",
|
|
97
97
|
"@types/pluralize": "^0.0.33",
|
|
98
|
-
"@velastack/kit": "^0.
|
|
98
|
+
"@velastack/kit": "^0.3.0",
|
|
99
99
|
"@velastack/pocketbase": "^0.2.0",
|
|
100
100
|
"@velastack/pocketbase-codegen": "^0.1.0",
|
|
101
101
|
"change-case": "^5.4.4",
|
|
@@ -4666,7 +4666,7 @@ var hc = {
|
|
|
4666
4666
|
tests: 0,
|
|
4667
4667
|
baseline: "velastack",
|
|
4668
4668
|
generate: mc
|
|
4669
|
-
}, gc = "pre[class*='language-'],\ncode[class*='language-'] {\n color: #d4d4d4;\n font-size: 13px;\n text-shadow: none;\n font-family: Menlo, Monaco, Consolas, 'Andale Mono', 'Ubuntu Mono', 'Courier New', monospace;\n direction: ltr;\n text-align: left;\n white-space: pre;\n word-spacing: normal;\n word-break: normal;\n line-height: 1.5;\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n -webkit-hyphens: none;\n -moz-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n}\n\npre[class*='language-']::selection,\ncode[class*='language-']::selection,\npre[class*='language-'] *::selection,\ncode[class*='language-'] *::selection {\n text-shadow: none;\n background: #264f78;\n}\n\n@media print {\n pre[class*='language-'],\n code[class*='language-'] {\n text-shadow: none;\n }\n}\n\npre[class*='language-'] {\n padding: 1em;\n margin: 0.5em 0;\n overflow: auto;\n background: oklch(0.21 0.034 264.665);\n}\n\n:not(pre) > code[class*='language-'] {\n padding: 0.1em 0.3em;\n border-radius: 0.3em;\n color: #db4c69;\n background: oklch(0.21 0.034 264.665);\n}\n/*********************************************************\n* Tokens\n*/\n.namespace {\n opacity: 0.7;\n}\n\n.token.doctype .token.doctype-tag {\n color: #569cd6;\n}\n\n.token.doctype .token.name {\n color: #9cdcfe;\n}\n\n.token.comment,\n.token.prolog {\n color: #6a9955;\n}\n\n.token.punctuation,\n.language-html .language-css .token.punctuation,\n.language-html .language-javascript .token.punctuation {\n color: #d4d4d4;\n}\n\n.token.property,\n.token.tag,\n.token.boolean,\n.token.number,\n.token.constant,\n.token.symbol,\n.token.inserted,\n.token.unit {\n color: #b5cea8;\n}\n\n.token.selector,\n.token.attr-name,\n.token.string,\n.token.char,\n.token.builtin,\n.token.deleted {\n color: #ce9178;\n}\n\n.language-css .token.string.url {\n text-decoration: underline;\n}\n\n.token.operator,\n.token.entity {\n color: #d4d4d4;\n}\n\n.token.operator.arrow {\n color: #569cd6;\n}\n\n.token.atrule {\n color: #ce9178;\n}\n\n.token.atrule .token.rule {\n color: #c586c0;\n}\n\n.token.atrule .token.url {\n color: #9cdcfe;\n}\n\n.token.atrule .token.url .token.function {\n color: #dcdcaa;\n}\n\n.token.atrule .token.url .token.punctuation {\n color: #d4d4d4;\n}\n\n.token.keyword {\n color: #569cd6;\n}\n\n.token.keyword.module,\n.token.keyword.control-flow {\n color: #c586c0;\n}\n\n.token.function,\n.token.function .token.maybe-class-name {\n color: #dcdcaa;\n}\n\n.token.regex {\n color: #d16969;\n}\n\n.token.important {\n color: #569cd6;\n}\n\n.token.italic {\n font-style: italic;\n}\n\n.token.constant {\n color: #9cdcfe;\n}\n\n.token.class-name,\n.token.maybe-class-name {\n color: #4ec9b0;\n}\n\n.token.console {\n color: #9cdcfe;\n}\n\n.token.parameter {\n color: #9cdcfe;\n}\n\n.token.interpolation {\n color: #9cdcfe;\n}\n\n.token.punctuation.interpolation-punctuation {\n color: #569cd6;\n}\n\n.token.boolean {\n color: #569cd6;\n}\n\n.token.property,\n.token.variable,\n.token.imports .token.maybe-class-name,\n.token.exports .token.maybe-class-name {\n color: #9cdcfe;\n}\n\n.token.selector {\n color: #d7ba7d;\n}\n\n.token.escape {\n color: #d7ba7d;\n}\n\n.token.tag {\n color: #569cd6;\n}\n\n.token.tag .token.punctuation {\n color: #808080;\n}\n\n.token.cdata {\n color: #808080;\n}\n\n.token.attr-name {\n color: #9cdcfe;\n}\n\n.token.attr-value,\n.token.attr-value .token.punctuation {\n color: #ce9178;\n}\n\n.token.attr-value .token.punctuation.attr-equals {\n color: #d4d4d4;\n}\n\n.token.entity {\n color: #569cd6;\n}\n\n.token.namespace {\n color: #4ec9b0;\n}\n/*********************************************************\n* Language Specific\n*/\n\npre[class*='language-javascript'],\ncode[class*='language-javascript'],\npre[class*='language-jsx'],\ncode[class*='language-jsx'],\npre[class*='language-typescript'],\ncode[class*='language-typescript'],\npre[class*='language-tsx'],\ncode[class*='language-tsx'] {\n color: #9cdcfe;\n}\n\npre[class*='language-css'],\ncode[class*='language-css'] {\n color: #ce9178;\n}\n\npre[class*='language-html'],\ncode[class*='language-html'] {\n color: #d4d4d4;\n}\n\n.language-regex .token.anchor {\n color: #dcdcaa;\n}\n\n.language-html .token.punctuation {\n color: #808080;\n}\n/*********************************************************\n* Line highlighting\n*/\npre[class*='language-'] > code[class*='language-'] {\n position: relative;\n z-index: 1;\n}\n\n.line-highlight.line-highlight {\n background: #f7ebc6;\n box-shadow: inset 5px 0 0 #f7d87c;\n z-index: 0;\n}\n", _c = "<script lang=\"ts\">\n import * as Avatar from '$lib/components/ui/avatar';\n import type { BlogAuthor } from '$lib/content';\n\n let {\n author,\n size = 'sm'\n }: { author: BlogAuthor; size?: 'sm' | 'default' | 'lg' } = $props();\n\n const initials = $derived(\n author.name\n .split(/\\s+/)\n .map((part) => part[0])\n .filter(Boolean)\n .slice(0, 2)\n .join('')\n .toUpperCase()\n );\n<\/script>\n\n<span class=\"inline-flex items-center gap-2\">\n <Avatar.Root {size}>\n {#if author.avatar}\n <Avatar.Image src={author.avatar} alt={author.name} />\n {/if}\n <Avatar.Fallback class=\"text-xs\">{initials}</Avatar.Fallback>\n </Avatar.Root>\n <span class=\"text-foreground text-sm font-medium\">{author.name}</span>\n</span>\n", vc = "<script lang=\"ts\">\n import * as Card from \"$lib/components/ui/card\";\n import { Badge } from \"$lib/components/ui/badge\";\n import AuthorChip from \"./AuthorChip.svelte\";\n import { formatDate } from \"$lib/utils/date\";\n import type { BlogPost, BlogPostSummary } from \"$lib/content\";\n\n let { post }: { post: BlogPost | BlogPostSummary } = $props();\n<\/script>\n\n<Card.Root class=\"hover:ring-foreground/20 h-full transition-shadow w-full\">\n <Card.Header>\n <Card.Title class=\"text-lg leading-snug\">\n <a href={`/blog/${post.slug}`} class=\"hover:underline\">\n {post.title}\n </a>\n </Card.Title>\n <Card.Description class=\"line-clamp-2\">\n {post.description}\n </Card.Description>\n </Card.Header>\n <Card.Content class=\"flex flex-1 flex-col justify-end gap-3\">\n {#if post.tags?.length}\n <div class=\"flex flex-wrap gap-1.5\">\n {#each post.tags as tag (tag)}\n <Badge href={`/blog/tags/${tag}`} variant=\"secondary\">{tag}</Badge>\n {/each}\n </div>\n {/if}\n <div\n class=\"text-muted-foreground flex items-center justify-between gap-3 text-xs\"\n >\n {#if post.author}\n <AuthorChip author={post.author} />\n {:else}\n <span></span>\n {/if}\n <span class=\"whitespace-nowrap\">\n <time datetime={post.createdDate.toISOString()}\n >{formatDate(post.createdDate)}</time\n >\n <span aria-hidden=\"true\">•</span>\n <span>{post.readingTime} min read</span>\n </span>\n </div>\n </Card.Content>\n</Card.Root>\n", yc = "---\ntitle: Design System Notes\ndescription: Small choices that make a design system feel coherent — spacing, radius, and the case for fewer variants.\ncreatedDate: 2025-12-15\ntags:\n - design\n - shadcn\nauthor:\n name: Ada Chen\n---\n\nWe've been cleaning up the design system recently. A few notes from the\npass, mostly for ourselves, partially in case they're useful to anyone\nelse building on top of shadcn.\n\n## The variants we actually use\n\nEvery primitive ships with a dozen variants. In practice our product\nleans on two or three per component:\n\n- **Buttons** — `default`, `ghost`, and `outline`. Destructive shows up\n rarely enough to be worth the extra click.\n- **Badges** — `default` and `secondary`. Tags and counts, nothing else.\n- **Cards** — one shape, with optional footer. Multiple card styles\n became indistinguishable from \"padded div,\" so we stopped.\n\nIf a variant hasn't appeared in a design in six months, it gets deleted.\nThe point isn't minimalism; it's that every extra variant is a decision\na future designer has to relitigate.\n\n## Spacing\n\nTailwind's default scale is good. We only locked in one rule: never use\nodd gaps. `gap-3` and `gap-5` stay; `gap-2.5` goes. It's a small thing\nthat quietly keeps vertical rhythm predictable across pages.\n\n## Radius\n\nOne radius token, applied everywhere. If a surface needs to feel\ndifferent, that's a structural decision — a card, a sheet, a popover —\nnot a one-off `rounded-md`. We ended up at `0.625rem` as our default\nand haven't wanted to change it.\n\n## Dark mode\n\nWe treat dark mode as a different palette, not a filter. Every token\nhas an explicit OKLCH value in both themes. When a component looks\noff in dark mode, the fix is almost always a token, not a tweak.\n", bc = "---\ntitle: Getting Started with SvelteKit\ndescription: The smallest useful SvelteKit project, explained end to end — routing, loading data, and the dev loop.\ncreatedDate: 2026-03-12\ntags:\n - sveltekit\n - tutorial\nauthor:\n name: Marco Alvarez\n---\n\nSvelteKit is the piece that turns Svelte — a component library — into\nsomething you can ship. Routing, server endpoints, data loading, builds,\nand deployment adapters all live in one place.\n\n## Creating a project\n\nThe fastest path is the CLI. It scaffolds a minimal project, installs\ndependencies, and leaves you with a working dev server.\n\n```bash\nnpx sv create my-app\ncd my-app\nnpm install\nnpm run dev\n```\n\n## Routes are files\n\nA route is a folder under `src/routes` with a `+page.svelte` inside.\nNested folders produce nested URLs. Dynamic segments use `[brackets]`.\n\n```\nsrc/routes/\n +page.svelte # /\n about/\n +page.svelte # /about\n blog/\n [slug]/\n +page.svelte # /blog/:slug\n```\n\n## Loading data\n\nA route's `+page.ts` (or `+page.server.ts` for server-only data) exports\na `load` function. Whatever it returns becomes `data` on the page.\n\n```ts\n// src/routes/blog/[slug]/+page.ts\nimport { error } from '@sveltejs/kit';\n\nexport const load = async ({ params }) => {\n const post = await fetchPost(params.slug);\n if (!post) throw error(404, 'Not found');\n return { post };\n};\n```\n\nThat's most of SvelteKit. The rest — form actions, hooks, adapters — are\nopt-in once you need them.\n", xc = "---\ntitle: A Pragmatic Performance Checklist\ndescription: The small set of things that have given us the biggest performance wins — in rough order of impact.\ncreatedDate: 2025-11-03\ntags:\n - performance\n - tutorial\nauthor:\n name: Marco Alvarez\n---\n\nWe don't have a performance budget so much as a performance allergy.\nWhen something feels slow, we profile, fix the obvious thing, and move\non. The list below is what \"the obvious thing\" usually is.\n\n> Premature optimization is the root of all evil, but ignoring a 3s\n> cold-start isn't optimization — it's negligence.\n\n## The checklist\n\n1. **Measure with real numbers.** Lighthouse and the Network tab answer\n most questions. If you're not measuring, you're guessing.\n2. **Serve fewer bytes.** Compress images (AVIF or WebP), remove unused\n fonts, and audit any dependency over 50KB gzipped.\n3. **Defer the non-critical.** Scripts that aren't needed above the\n fold can wait. `loading=\"lazy\"` on images, `defer` on scripts, and\n dynamic `import()` for interactive widgets.\n4. **Cache at the edge.** If the same HTML could serve a thousand users,\n it should. Use your adapter's cache headers; don't hand-roll it.\n5. **Avoid waterfalls.** If page load depends on three sequential fetches,\n collapse them into one endpoint or preload the critical ones.\n6. **Trust the framework.** SvelteKit's `load` functions run in parallel\n by default and the compiler already strips unused code. Most hand-rolled\n cleverness just gets in the way.\n\n## What we stopped worrying about\n\n- Micro-optimizations inside component code — the bundle is small, the\n diff is fast. The savings are real but rarely matter.\n- Third-party tooling that promises \"speed.\" If it adds a build step,\n the benefit needs to be measurable, not theoretical.\n\n## When to go deeper\n\nIf the checklist doesn't move the needle, the next step is almost\nalways a deeper look at the data layer — query plans, N+1 fetches, cold\ncache behavior. But you should have exhausted the list above before\ngetting there. Most slowness is boring, and most fixes are too.\n", Sc = "---\ntitle: Welcome to the Blog\ndescription: A quick note on what this space is for and what to expect from us.\ncreatedDate: 2026-04-20\ntags:\n - announcements\nauthor:\n name: Ada Chen\n---\n\nWelcome in. This blog is where we write about the things we build, the\ndecisions behind them, and what we learn when they go sideways.\n\nYou can expect a mix of short notes and longer walkthroughs. No schedule,\nno filler. If a post exists it's because something was worth writing down.\n\nA few threads you'll see pop up often:\n\n- Product notes on what we're shipping and why\n- Practical tutorials for the tools we use every day\n- Design and engineering decisions that took more than five minutes\n\nIf you'd rather not check back manually, the [RSS feed](/blog/rss.xml)\nhas every post. Thanks for reading.\n", Cc = "---\ntitle: Why We Chose Tailwind v4\ndescription: Notes on moving from a traditional CSS pipeline to Tailwind v4's zero-config, CSS-first setup.\ncreatedDate: 2026-02-18\ntags:\n - tailwind\n - design\nauthor:\n name: Ada Chen\n---\n\nTailwind v4 is a meaningful rewrite. The surface API still looks the same\n— utility classes on elements — but the compiler, configuration model,\nand theming story all changed in ways that made us want to adopt it.\n\n> The point of a design system isn't to ship fewer classes. It's to make\n> the next decision easier than the last.\n\n## What changed for us\n\nThree things mattered:\n\n1. **CSS-first config.** `tailwind.config.js` is gone. Tokens live in\n `app.css` as real CSS custom properties, which means they also work\n outside of Tailwind — SVG fills, inline styles, wherever.\n2. **OKLCH colors.** Designers can reason about lightness and chroma\n independently. Contrast checks become much easier to eyeball.\n3. **Speed.** The new engine compiles fast enough that we stopped\n thinking about purge lists. Dev feedback is effectively instant.\n\n## The config we kept\n\nWe pinned two things in `app.css`:\n\n```css\n@import 'tailwindcss';\n@plugin '@tailwindcss/typography';\n\n:root {\n --radius: 0.625rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.129 0.042 264.695);\n}\n```\n\nEverything else — spacing, typography, breakpoints — falls back to\ndefaults until we have a reason to override it.\n\n## What we'd tell a team evaluating it\n\nIf you're already using Tailwind v3, the migration is mostly a config\nmove. If you're starting from scratch, v4 removes a pile of decisions\nyou'd otherwise be making on day one. That alone made it worth it.\n", wc = "---\ntitle: Writing Posts with MDsveX\ndescription: How this blog turns markdown files into real Svelte components — frontmatter, code, and embedded UI.\ncreatedDate: 2026-01-28\nupdatedDate: 2026-02-02\ntags:\n - mdsvex\n - tutorial\nauthor:\n name: Priya Shah\n---\n\nPosts on this blog are `.svx` files. Each one is a real Svelte component\nat build time, so Markdown and Svelte sit side by side with no glue\ncode.\n\n## Frontmatter\n\nYAML at the top of a post becomes the `metadata` export. The loader\nreads it to build the list view, tag pages, and RSS feed.\n\n```yaml\n---\ntitle: Writing Posts with MDsveX\ndescription: A short description shown in previews.\ncreatedDate: 2026-01-28\ntags:\n - mdsvex\n - tutorial\nauthor:\n name: Priya Shah\n---\n```\n\n## Markdown works the way you'd expect\n\nHeadings, lists, links, blockquotes, and inline `code` all render.\nFenced code blocks pick up language hints for syntax highlighting when a\nplugin is enabled.\n\n```ts\nfunction greet(name: string) {\n return `hello, ${name}`;\n}\n```\n\n## Images\n\nPut images in `static/` and reference them with a root-relative path:\n\n```md\n\n```\n\n## Svelte in your posts\n\nThe superpower is that you can drop components straight into a post —\na chart, an interactive demo, a call-to-action card. The rules are the\nsame as any other Svelte file:\n\n```svelte\n<script>\n import Callout from '$lib/components/Callout.svelte';\n<\/script>\n\n<Callout>This is a real component inside a markdown post.</Callout>\n```\n\nThat's the whole pipeline. Write markdown, sprinkle in components when\nplain text stops being enough, and the rest is just Svelte.\n", Tc = "import type { Component } from \"svelte\";\n\nexport type BlogAuthor = {\n name: string;\n avatar?: string;\n};\n\nexport type BlogMetadata = {\n title: string;\n description: string;\n createdDate: string;\n updatedDate?: string;\n tags?: string[];\n author?: BlogAuthor;\n};\n\nexport type BlogModules = Record<\n string,\n { default: Component; metadata: BlogMetadata }\n>;\n\nexport type BlogRawModules = Record<string, string>;\n\nexport type BlogPost = {\n slug: string;\n title: string;\n description: string;\n createdDate: Date;\n updatedDate?: Date;\n tags?: string[];\n author?: BlogAuthor;\n readingTime: number;\n component: Component;\n};\n\nexport type BlogPostSummary = Omit<BlogPost, \"component\">;\n\nconst WORDS_PER_MINUTE = 220;\n\nfunction getBlogModules() {\n return import.meta.glob(\"$lib/content/blog/*.svx\", {\n eager: true,\n }) as BlogModules;\n}\n\nfunction getBlogRawModules() {\n return import.meta.glob(\"$lib/content/blog/*.svx\", {\n eager: true,\n query: \"?raw\",\n import: \"default\",\n }) as BlogRawModules;\n}\n\nfunction stripFrontmatter(raw: string) {\n if (!raw.startsWith(\"---\")) return raw;\n const end = raw.indexOf(\"\\n---\", 3);\n if (end === -1) return raw;\n return raw.slice(end + 4);\n}\n\nfunction computeReadingTime(raw: string) {\n const body = stripFrontmatter(raw);\n const words = body.split(/\\s+/).filter(Boolean).length;\n return Math.max(1, Math.ceil(words / WORDS_PER_MINUTE));\n}\n\nexport function getBlogPosts(): BlogPost[] {\n const modules = getBlogModules();\n const rawModules = getBlogRawModules();\n\n const posts = Object.entries(modules).map(([path, module]) => {\n const filename = path.split(\"/\").pop() ?? \"\";\n const slug = filename.replace(\".svx\", \"\");\n const raw = rawModules[path] ?? \"\";\n\n return {\n slug,\n title: module.metadata.title,\n description: module.metadata.description,\n createdDate: new Date(module.metadata.createdDate),\n updatedDate: module.metadata.updatedDate\n ? new Date(module.metadata.updatedDate)\n : undefined,\n tags: module.metadata.tags,\n author: module.metadata.author,\n readingTime: computeReadingTime(raw),\n component: module.default,\n };\n });\n\n posts.sort((a, b) => b.createdDate.getTime() - a.createdDate.getTime());\n return posts;\n}\n\nexport function getBlogPost(slug: string) {\n const posts = getBlogPosts();\n return posts.find((post) => post.slug === slug) ?? null;\n}\n\nexport function getBlogPostRaw(slug: string): string | null {\n const rawModules = getBlogRawModules();\n for (const [path, raw] of Object.entries(rawModules)) {\n const filename = path.split(\"/\").pop() ?? \"\";\n if (filename.replace(\".svx\", \"\") === slug) return raw;\n }\n return null;\n}\n\nexport function getBlogPostsByTag(tag: string) {\n return getBlogPosts().filter((post) => post.tags?.includes(tag));\n}\n\nexport function getAllTags(): { tag: string; count: number }[] {\n const counts = new Map<string, number>();\n for (const post of getBlogPosts()) {\n for (const tag of post.tags ?? []) {\n counts.set(tag, (counts.get(tag) ?? 0) + 1);\n }\n }\n return [...counts.entries()]\n .map(([tag, count]) => ({ tag, count }))\n .sort((a, b) => b.count - a.count || a.tag.localeCompare(b.tag));\n}\n\nexport function getAdjacentPosts(slug: string): {\n prev: BlogPost | null;\n next: BlogPost | null;\n} {\n const posts = getBlogPosts();\n const index = posts.findIndex((post) => post.slug === slug);\n if (index === -1) return { prev: null, next: null };\n return {\n next: index > 0 ? posts[index - 1] : null,\n prev: index < posts.length - 1 ? posts[index + 1] : null,\n };\n}\n\nexport function getRelatedPosts(slug: string, limit = 3): BlogPost[] {\n const posts = getBlogPosts();\n const current = posts.find((post) => post.slug === slug);\n if (!current?.tags?.length) return [];\n\n const currentTags = new Set(current.tags);\n\n return posts\n .filter((post) => post.slug !== slug && post.tags?.length)\n .map((post) => ({\n post,\n overlap: post.tags!.filter((tag) => currentTags.has(tag)).length,\n }))\n .filter(({ overlap }) => overlap > 0)\n .sort(\n (a, b) =>\n b.overlap - a.overlap ||\n b.post.createdDate.getTime() - a.post.createdDate.getTime(),\n )\n .slice(0, limit)\n .map(({ post }) => post);\n}\n", Ec = "const formatter = new Intl.DateTimeFormat(\"en-US\", {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n});\n\nexport function formatDate(date: Date) {\n return formatter.format(date);\n}\n", Dc = "<script lang=\"ts\">\n import * as Breadcrumb from \"$lib/components/ui/breadcrumb\";\n import { page } from \"$app/state\";\n\n let { children } = $props();\n\n let breadcrumbs = $derived(page.data.breadcrumbs || []) as {\n title: string;\n url: string;\n }[];\n<\/script>\n\n<section data-role=\"content\">\n <Breadcrumb.Root class=\"mb-6\">\n <Breadcrumb.List>\n {#if breadcrumbs.length > 1}\n {#each breadcrumbs.slice(0, -1) as breadcrumb}\n <Breadcrumb.Item>\n <Breadcrumb.Link href={breadcrumb.url}\n >{breadcrumb.title}</Breadcrumb.Link\n >\n </Breadcrumb.Item>\n <Breadcrumb.Separator />\n {/each}\n {/if}\n <Breadcrumb.Page>\n {breadcrumbs[breadcrumbs.length - 1].title}\n </Breadcrumb.Page>\n </Breadcrumb.List>\n </Breadcrumb.Root>\n\n {@render children?.()}\n</section>\n", Oc = "<script lang=\"ts\">\n import { Badge } from \"$lib/components/ui/badge\";\n import { Button } from \"$lib/components/ui/button\";\n import PostCard from \"$lib/components/blog/PostCard.svelte\";\n import Rss from \"@lucide/svelte/icons/rss\";\n\n let { data } = $props();\n<\/script>\n\n<div class=\"flex flex-col gap-10\">\n <header\n class=\"flex flex-col gap-4 md:flex-row md:items-end md:justify-between\"\n >\n <div class=\"max-w-2xl\">\n <h1 class=\"text-3xl font-semibold tracking-tight sm:text-4xl\">Blog</h1>\n <p class=\"text-muted-foreground mt-2 text-base\">\n Product notes, tutorials, and engineering posts from the team.\n </p>\n </div>\n <Button href=\"/blog/rss.xml\" variant=\"outline\" size=\"sm\" class=\"w-fit\">\n <Rss class=\"size-4\" />\n RSS\n </Button>\n </header>\n\n <ul class=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {#each data.blogPosts as post (post.slug)}\n <li class=\"flex w-full\">\n <PostCard {post} />\n </li>\n {/each}\n </ul>\n</div>\n", kc = "import { definePageMetaTags } from \"svelte-meta-tags\";\nimport { getAllTags, getBlogPosts } from \"$lib/content\";\n\nexport const load = async ({ parent }) => {\n await parent();\n\n const blogPosts = getBlogPosts();\n const allTags = getAllTags();\n\n const pageMetaTags = definePageMetaTags({\n title: \"Blog\",\n description: \"Product notes, tutorials, and engineering posts.\",\n });\n\n const breadcrumbs = [\n { title: \"Home\", url: \"/\" },\n { title: \"Blog\", url: \"/blog\" },\n ];\n\n return { blogPosts, allTags, breadcrumbs, ...pageMetaTags };\n};\n", Ac = "<script lang=\"ts\">\n import { Badge } from \"$lib/components/ui/badge\";\n import { Separator } from \"$lib/components/ui/separator\";\n import AuthorChip from \"$lib/components/blog/AuthorChip.svelte\";\n import PostCard from \"$lib/components/blog/PostCard.svelte\";\n import { formatDate } from \"$lib/utils/date\";\n import * as Breadcrumb from \"$lib/components/ui/breadcrumb\";\n import ArrowLeft from \"@lucide/svelte/icons/arrow-left\";\n import ArrowRight from \"@lucide/svelte/icons/arrow-right\";\n import { page } from \"$app/state\";\n\n let { data } = $props();\n let breadcrumbs = $derived(page.data.breadcrumbs || []) as {\n title: string;\n url: string;\n }[];\n<\/script>\n\n<div class=\"flex flex-col gap-6\">\n <header class=\"flex flex-col gap-5 border-b border-border pb-8\">\n <div class=\"flex flex-col gap-3\">\n <h1 class=\"text-3xl font-semibold tracking-tight sm:text-4xl\">\n {data.blogPost.title}\n </h1>\n <p class=\"text-muted-foreground text-lg\">\n {data.blogPost.description}\n </p>\n </div>\n\n <div\n class=\"text-muted-foreground flex flex-wrap items-center gap-x-1 gap-y-2 text-sm\"\n >\n {#if data.blogPost.author}\n <AuthorChip author={data.blogPost.author} />\n <span aria-hidden=\"true\" class=\"text-muted-foreground/50\">•</span>\n {/if}\n <time datetime={data.blogPost.createdDate.toISOString()}>\n {formatDate(data.blogPost.createdDate)}\n </time>\n {#if data.blogPost.updatedDate}\n <span aria-hidden=\"true\" class=\"text-muted-foreground/50\">•</span>\n <span>Updated {formatDate(data.blogPost.updatedDate)}</span>\n {/if}\n <span aria-hidden=\"true\" class=\"text-muted-foreground/50\">•</span>\n <span>{data.blogPost.readingTime} min read</span>\n </div>\n\n {#if data.blogPost.tags?.length}\n <div class=\"flex flex-wrap gap-1.5\">\n {#each data.blogPost.tags as tag (tag)}\n <Badge href={`/blog/tags/${tag}`} variant=\"secondary\">{tag}</Badge>\n {/each}\n </div>\n {/if}\n </header>\n\n <article\n class=\"prose dark:prose-invert max-w-prose prose-headings:mb-0 prose-headings:mt-4\"\n >\n <data.blogPost.component />\n </article>\n\n <Separator />\n\n <nav class=\"grid gap-3 sm:grid-cols-2\" aria-label=\"Post navigation\">\n {#if data.adjacent.prev}\n <a\n href={`/blog/${data.adjacent.prev.slug}`}\n class=\"ring-foreground/10 hover:ring-foreground/20 bg-card text-card-foreground group flex flex-col gap-1 rounded-xl p-4 ring-1 transition-shadow\"\n >\n <span\n class=\"text-muted-foreground inline-flex items-center gap-1 text-xs font-medium uppercase tracking-wide\"\n >\n <ArrowLeft class=\"size-3.5\" />\n Previous\n </span>\n <span class=\"font-medium group-hover:underline\"\n >{data.adjacent.prev.title}</span\n >\n </a>\n {:else}\n <div></div>\n {/if}\n\n {#if data.adjacent.next}\n <a\n href={`/blog/${data.adjacent.next.slug}`}\n class=\"ring-foreground/10 hover:ring-foreground/20 bg-card text-card-foreground group flex flex-col gap-1 rounded-xl p-4 text-right ring-1 transition-shadow sm:col-start-2\"\n >\n <span\n class=\"text-muted-foreground inline-flex items-center justify-end gap-1 text-xs font-medium uppercase tracking-wide\"\n >\n Next\n <ArrowRight class=\"size-3.5\" />\n </span>\n <span class=\"font-medium group-hover:underline\"\n >{data.adjacent.next.title}</span\n >\n </a>\n {/if}\n </nav>\n\n {#if data.related.length}\n <section class=\"flex flex-col gap-4\">\n <Separator />\n <h2 class=\"text-xl font-semibold tracking-tight\">Related posts</h2>\n <ul class=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {#each data.related as post (post.slug)}\n <li class=\"flex\">\n <PostCard {post} />\n </li>\n {/each}\n </ul>\n </section>\n {/if}\n</div>\n", jc = "import { error } from \"@sveltejs/kit\";\nimport { definePageMetaTags } from \"svelte-meta-tags\";\nimport {\n getAdjacentPosts,\n getBlogPost,\n getBlogPosts,\n getRelatedPosts,\n} from \"$lib/content\";\n\nexport const load = async ({ params, parent }) => {\n await parent();\n\n const blogPost = getBlogPost(params.slug);\n\n if (blogPost === null) {\n throw error(404, \"Page not found\");\n }\n\n const adjacent = getAdjacentPosts(params.slug);\n const related = getRelatedPosts(params.slug);\n\n const pageMetaTags = definePageMetaTags({\n title: blogPost.title,\n description: blogPost.description,\n });\n\n const breadcrumbs = [\n { title: \"Home\", url: \"/\" },\n { title: \"Blog\", url: \"/blog\" },\n { title: blogPost.title, url: `/blog/${blogPost.slug}` },\n ];\n\n return { blogPost, adjacent, related, breadcrumbs, ...pageMetaTags };\n};\n\nexport const entries = async () => {\n return getBlogPosts().map((post) => ({ slug: post.slug }));\n};\n", Mc = "import { getBlogPosts } from \"$lib/content\";\n\nexport const prerender = true;\n\nfunction escapeXml(value: string) {\n return value\n .replace(/&/g, \"&\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\");\n}\n\nexport const GET = async ({ locals }) => {\n const { appName, appURL } = locals.meta;\n const posts = getBlogPosts();\n const siteURL = appURL.replace(/\\/$/, \"\");\n const feedURL = `${siteURL}/blog/rss.xml`;\n const lastBuild = (\n posts[0]?.updatedDate ??\n posts[0]?.createdDate ??\n new Date()\n ).toUTCString();\n\n const items = posts\n .map((post) => {\n const link = `${siteURL}/blog/${post.slug}`;\n const pubDate = post.createdDate.toUTCString();\n const categories = (post.tags ?? [])\n .map((tag) => ` <category>${escapeXml(tag)}</category>`)\n .join(\"\\n\");\n const creator = post.author\n ? ` <dc:creator>${escapeXml(post.author.name)}</dc:creator>`\n : \"\";\n\n return [\n \" <item>\",\n ` <title>${escapeXml(post.title)}</title>`,\n ` <link>${escapeXml(link)}</link>`,\n ` <guid isPermaLink=\"true\">${escapeXml(link)}</guid>`,\n ` <description>${escapeXml(post.description)}</description>`,\n ` <pubDate>${pubDate}</pubDate>`,\n creator,\n categories,\n \" </item>\",\n ]\n .filter(Boolean)\n .join(\"\\n\");\n })\n .join(\"\\n\");\n\n const xml = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n<channel>\n <title>${escapeXml(appName)}</title>\n <link>${escapeXml(`${siteURL}/blog`)}</link>\n <atom:link href=\"${escapeXml(feedURL)}\" rel=\"self\" type=\"application/rss+xml\" />\n <description>${escapeXml(`Latest posts from ${appName}.`)}</description>\n <language>en</language>\n <lastBuildDate>${lastBuild}</lastBuildDate>\n${items}\n</channel>\n</rss>\n`;\n\n return new Response(xml, {\n headers: {\n \"Content-Type\": \"application/xml; charset=utf-8\",\n \"Cache-Control\": \"max-age=0, s-maxage=3600\",\n },\n });\n};\n", Nc = "<script lang=\"ts\">\n import { Badge } from \"$lib/components/ui/badge\";\n\n let { data } = $props();\n<\/script>\n\n<div class=\"flex flex-col gap-8\">\n <header class=\"flex flex-col gap-2\">\n <h1 class=\"text-3xl font-semibold tracking-tight sm:text-4xl\">Tags</h1>\n <p class=\"text-muted-foreground text-base\">\n {data.allTags.length}\n {data.allTags.length === 1 ? \"tag\" : \"tags\"} used across the blog.\n </p>\n </header>\n\n {#if data.allTags.length}\n <ul class=\"flex flex-wrap gap-2\">\n {#each data.allTags as { tag, count } (tag)}\n <li>\n <Badge href={`/blog/tags/${tag}`} variant=\"secondary\">\n {tag}\n <span class=\"text-muted-foreground ml-0.5\">{count}</span>\n </Badge>\n </li>\n {/each}\n </ul>\n {:else}\n <p class=\"text-muted-foreground\">No tags yet.</p>\n {/if}\n</div>\n", Pc = "import { definePageMetaTags } from \"svelte-meta-tags\";\nimport { getAllTags } from \"$lib/content\";\n\nexport const load = async ({ parent }) => {\n await parent();\n\n const allTags = getAllTags();\n\n const pageMetaTags = definePageMetaTags({\n title: \"Tags\",\n description: \"All tags used on the blog.\",\n });\n\n const breadcrumbs = [\n { title: \"Home\", url: \"/\" },\n { title: \"Blog\", url: \"/blog\" },\n { title: \"Tags\", url: \"/blog/tags\" },\n ];\n\n return { allTags, breadcrumbs, ...pageMetaTags };\n};\n", Fc = "<script lang=\"ts\">\n import PostCard from \"$lib/components/blog/PostCard.svelte\";\n\n let { data } = $props();\n<\/script>\n\n<div class=\"flex flex-col gap-8\">\n <header class=\"flex flex-col gap-2\">\n <h1 class=\"text-3xl font-semibold tracking-tight sm:text-4xl\">\n {data.tag}\n </h1>\n <p class=\"text-muted-foreground text-base\">\n {data.blogPosts.length}\n {data.blogPosts.length === 1 ? \"post\" : \"posts\"} tagged \"{data.tag}\".\n </p>\n </header>\n\n <ul class=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {#each data.blogPosts as post (post.slug)}\n <li class=\"flex\">\n <PostCard {post} />\n </li>\n {/each}\n </ul>\n</div>\n", Ic = "import { error } from \"@sveltejs/kit\";\nimport { definePageMetaTags } from \"svelte-meta-tags\";\nimport { getAllTags, getBlogPostsByTag } from \"$lib/content\";\n\nexport const load = async ({ params, parent }) => {\n await parent();\n\n const blogPosts = getBlogPostsByTag(params.tag);\n\n if (blogPosts.length === 0) {\n throw error(404, \"Tag not found\");\n }\n\n const pageMetaTags = definePageMetaTags({\n title: `Posts tagged \"${params.tag}\"`,\n description: `Blog posts tagged \"${params.tag}\".`,\n });\n\n const breadcrumbs = [\n { title: \"Home\", url: \"/\" },\n { title: \"Blog\", url: \"/blog\" },\n { title: \"Tags\", url: \"/blog/tags\" },\n { title: params.tag, url: `/blog/tags/${params.tag}` },\n ];\n\n return { blogPosts, tag: params.tag, breadcrumbs, ...pageMetaTags };\n};\n\nexport const entries = async () => {\n return getAllTags().map(({ tag }) => ({ tag }));\n};\n", Lc = "import { negotiate } from \"$lib/negotiate\";\nimport { getBlogPostRaw } from \"$lib/content\";\n\nexport const load = async ({ params, locals }) => {\n return {\n ...negotiate(locals, {\n \"text/markdown\": () => getBlogPostRaw(params.slug) ?? \"\",\n }),\n };\n};\n", Rc = /* #__PURE__ */ Object.assign({
|
|
4669
|
+
}, gc = "pre[class*='language-'],\ncode[class*='language-'] {\n color: #d4d4d4;\n font-size: 13px;\n text-shadow: none;\n font-family: Menlo, Monaco, Consolas, 'Andale Mono', 'Ubuntu Mono', 'Courier New', monospace;\n direction: ltr;\n text-align: left;\n white-space: pre;\n word-spacing: normal;\n word-break: normal;\n line-height: 1.5;\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n -webkit-hyphens: none;\n -moz-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n}\n\npre[class*='language-']::selection,\ncode[class*='language-']::selection,\npre[class*='language-'] *::selection,\ncode[class*='language-'] *::selection {\n text-shadow: none;\n background: #264f78;\n}\n\n@media print {\n pre[class*='language-'],\n code[class*='language-'] {\n text-shadow: none;\n }\n}\n\npre[class*='language-'] {\n padding: 1em;\n margin: 0.5em 0;\n overflow: auto;\n background: oklch(0.21 0.034 264.665);\n}\n\n:not(pre) > code[class*='language-'] {\n padding: 0.1em 0.3em;\n border-radius: 0.3em;\n color: #db4c69;\n background: oklch(0.21 0.034 264.665);\n}\n/*********************************************************\n* Tokens\n*/\n.namespace {\n opacity: 0.7;\n}\n\n.token.doctype .token.doctype-tag {\n color: #569cd6;\n}\n\n.token.doctype .token.name {\n color: #9cdcfe;\n}\n\n.token.comment,\n.token.prolog {\n color: #6a9955;\n}\n\n.token.punctuation,\n.language-html .language-css .token.punctuation,\n.language-html .language-javascript .token.punctuation {\n color: #d4d4d4;\n}\n\n.token.property,\n.token.tag,\n.token.boolean,\n.token.number,\n.token.constant,\n.token.symbol,\n.token.inserted,\n.token.unit {\n color: #b5cea8;\n}\n\n.token.selector,\n.token.attr-name,\n.token.string,\n.token.char,\n.token.builtin,\n.token.deleted {\n color: #ce9178;\n}\n\n.language-css .token.string.url {\n text-decoration: underline;\n}\n\n.token.operator,\n.token.entity {\n color: #d4d4d4;\n}\n\n.token.operator.arrow {\n color: #569cd6;\n}\n\n.token.atrule {\n color: #ce9178;\n}\n\n.token.atrule .token.rule {\n color: #c586c0;\n}\n\n.token.atrule .token.url {\n color: #9cdcfe;\n}\n\n.token.atrule .token.url .token.function {\n color: #dcdcaa;\n}\n\n.token.atrule .token.url .token.punctuation {\n color: #d4d4d4;\n}\n\n.token.keyword {\n color: #569cd6;\n}\n\n.token.keyword.module,\n.token.keyword.control-flow {\n color: #c586c0;\n}\n\n.token.function,\n.token.function .token.maybe-class-name {\n color: #dcdcaa;\n}\n\n.token.regex {\n color: #d16969;\n}\n\n.token.important {\n color: #569cd6;\n}\n\n.token.italic {\n font-style: italic;\n}\n\n.token.constant {\n color: #9cdcfe;\n}\n\n.token.class-name,\n.token.maybe-class-name {\n color: #4ec9b0;\n}\n\n.token.console {\n color: #9cdcfe;\n}\n\n.token.parameter {\n color: #9cdcfe;\n}\n\n.token.interpolation {\n color: #9cdcfe;\n}\n\n.token.punctuation.interpolation-punctuation {\n color: #569cd6;\n}\n\n.token.boolean {\n color: #569cd6;\n}\n\n.token.property,\n.token.variable,\n.token.imports .token.maybe-class-name,\n.token.exports .token.maybe-class-name {\n color: #9cdcfe;\n}\n\n.token.selector {\n color: #d7ba7d;\n}\n\n.token.escape {\n color: #d7ba7d;\n}\n\n.token.tag {\n color: #569cd6;\n}\n\n.token.tag .token.punctuation {\n color: #808080;\n}\n\n.token.cdata {\n color: #808080;\n}\n\n.token.attr-name {\n color: #9cdcfe;\n}\n\n.token.attr-value,\n.token.attr-value .token.punctuation {\n color: #ce9178;\n}\n\n.token.attr-value .token.punctuation.attr-equals {\n color: #d4d4d4;\n}\n\n.token.entity {\n color: #569cd6;\n}\n\n.token.namespace {\n color: #4ec9b0;\n}\n/*********************************************************\n* Language Specific\n*/\n\npre[class*='language-javascript'],\ncode[class*='language-javascript'],\npre[class*='language-jsx'],\ncode[class*='language-jsx'],\npre[class*='language-typescript'],\ncode[class*='language-typescript'],\npre[class*='language-tsx'],\ncode[class*='language-tsx'] {\n color: #9cdcfe;\n}\n\npre[class*='language-css'],\ncode[class*='language-css'] {\n color: #ce9178;\n}\n\npre[class*='language-html'],\ncode[class*='language-html'] {\n color: #d4d4d4;\n}\n\n.language-regex .token.anchor {\n color: #dcdcaa;\n}\n\n.language-html .token.punctuation {\n color: #808080;\n}\n/*********************************************************\n* Line highlighting\n*/\npre[class*='language-'] > code[class*='language-'] {\n position: relative;\n z-index: 1;\n}\n\n.line-highlight.line-highlight {\n background: #f7ebc6;\n box-shadow: inset 5px 0 0 #f7d87c;\n z-index: 0;\n}\n", _c = "<script lang=\"ts\">\n import * as Avatar from '$lib/components/ui/avatar';\n import type { BlogAuthor } from '$lib/content';\n\n let {\n author,\n size = 'sm'\n }: { author: BlogAuthor; size?: 'sm' | 'default' | 'lg' } = $props();\n\n const initials = $derived(\n author.name\n .split(/\\s+/)\n .map((part) => part[0])\n .filter(Boolean)\n .slice(0, 2)\n .join('')\n .toUpperCase()\n );\n<\/script>\n\n<span class=\"inline-flex items-center gap-2\">\n <Avatar.Root {size}>\n {#if author.avatar}\n <Avatar.Image src={author.avatar} alt={author.name} />\n {/if}\n <Avatar.Fallback class=\"text-xs\">{initials}</Avatar.Fallback>\n </Avatar.Root>\n <span class=\"text-foreground text-sm font-medium\">{author.name}</span>\n</span>\n", vc = "<script lang=\"ts\">\n import * as Card from \"$lib/components/ui/card\";\n import { Badge } from \"$lib/components/ui/badge\";\n import AuthorChip from \"./AuthorChip.svelte\";\n import { formatDate } from \"$lib/utils/date\";\n import type { BlogPost, BlogPostSummary } from \"$lib/content\";\n\n let { post }: { post: BlogPost | BlogPostSummary } = $props();\n<\/script>\n\n<Card.Root class=\"hover:ring-foreground/20 h-full transition-shadow w-full\">\n <Card.Header>\n <Card.Title class=\"text-lg leading-snug\">\n <a href={`/blog/${post.slug}`} class=\"hover:underline\">\n {post.title}\n </a>\n </Card.Title>\n <Card.Description class=\"line-clamp-2\">\n {post.description}\n </Card.Description>\n </Card.Header>\n <Card.Content class=\"flex flex-1 flex-col justify-end gap-3\">\n {#if post.tags?.length}\n <div class=\"flex flex-wrap gap-1.5\">\n {#each post.tags as tag (tag)}\n <Badge href={`/blog/tags/${tag}`} variant=\"secondary\">{tag}</Badge>\n {/each}\n </div>\n {/if}\n <div\n class=\"text-muted-foreground flex items-center justify-between gap-3 text-xs\"\n >\n {#if post.author}\n <AuthorChip author={post.author} />\n {:else}\n <span></span>\n {/if}\n <span class=\"whitespace-nowrap\">\n <time datetime={post.createdDate.toISOString()}\n >{formatDate(post.createdDate)}</time\n >\n <span aria-hidden=\"true\">•</span>\n <span>{post.readingTime} min read</span>\n </span>\n </div>\n </Card.Content>\n</Card.Root>\n", yc = "---\ntitle: Design System Notes\ndescription: Small choices that make a design system feel coherent — spacing, radius, and the case for fewer variants.\ncreatedDate: 2025-12-15\ntags:\n - design\n - shadcn\nauthor:\n name: Ada Chen\n---\n\nWe've been cleaning up the design system recently. A few notes from the\npass, mostly for ourselves, partially in case they're useful to anyone\nelse building on top of shadcn.\n\n## The variants we actually use\n\nEvery primitive ships with a dozen variants. In practice our product\nleans on two or three per component:\n\n- **Buttons** — `default`, `ghost`, and `outline`. Destructive shows up\n rarely enough to be worth the extra click.\n- **Badges** — `default` and `secondary`. Tags and counts, nothing else.\n- **Cards** — one shape, with optional footer. Multiple card styles\n became indistinguishable from \"padded div,\" so we stopped.\n\nIf a variant hasn't appeared in a design in six months, it gets deleted.\nThe point isn't minimalism; it's that every extra variant is a decision\na future designer has to relitigate.\n\n## Spacing\n\nTailwind's default scale is good. We only locked in one rule: never use\nodd gaps. `gap-3` and `gap-5` stay; `gap-2.5` goes. It's a small thing\nthat quietly keeps vertical rhythm predictable across pages.\n\n## Radius\n\nOne radius token, applied everywhere. If a surface needs to feel\ndifferent, that's a structural decision — a card, a sheet, a popover —\nnot a one-off `rounded-md`. We ended up at `0.625rem` as our default\nand haven't wanted to change it.\n\n## Dark mode\n\nWe treat dark mode as a different palette, not a filter. Every token\nhas an explicit OKLCH value in both themes. When a component looks\noff in dark mode, the fix is almost always a token, not a tweak.\n", bc = "---\ntitle: Getting Started with SvelteKit\ndescription: The smallest useful SvelteKit project, explained end to end — routing, loading data, and the dev loop.\ncreatedDate: 2026-03-12\ntags:\n - sveltekit\n - tutorial\nauthor:\n name: Marco Alvarez\n---\n\nSvelteKit is the piece that turns Svelte — a component library — into\nsomething you can ship. Routing, server endpoints, data loading, builds,\nand deployment adapters all live in one place.\n\n## Creating a project\n\nThe fastest path is the CLI. It scaffolds a minimal project, installs\ndependencies, and leaves you with a working dev server.\n\n```bash\nnpx sv create my-app\ncd my-app\nnpm install\nnpm run dev\n```\n\n## Routes are files\n\nA route is a folder under `src/routes` with a `+page.svelte` inside.\nNested folders produce nested URLs. Dynamic segments use `[brackets]`.\n\n```\nsrc/routes/\n +page.svelte # /\n about/\n +page.svelte # /about\n blog/\n [slug]/\n +page.svelte # /blog/:slug\n```\n\n## Loading data\n\nA route's `+page.ts` (or `+page.server.ts` for server-only data) exports\na `load` function. Whatever it returns becomes `data` on the page.\n\n```ts\n// src/routes/blog/[slug]/+page.ts\nimport { error } from '@sveltejs/kit';\n\nexport const load = async ({ params }) => {\n const post = await fetchPost(params.slug);\n if (!post) throw error(404, 'Not found');\n return { post };\n};\n```\n\nThat's most of SvelteKit. The rest — form actions, hooks, adapters — are\nopt-in once you need them.\n", xc = "---\ntitle: A Pragmatic Performance Checklist\ndescription: The small set of things that have given us the biggest performance wins — in rough order of impact.\ncreatedDate: 2025-11-03\ntags:\n - performance\n - tutorial\nauthor:\n name: Marco Alvarez\n---\n\nWe don't have a performance budget so much as a performance allergy.\nWhen something feels slow, we profile, fix the obvious thing, and move\non. The list below is what \"the obvious thing\" usually is.\n\n> Premature optimization is the root of all evil, but ignoring a 3s\n> cold-start isn't optimization — it's negligence.\n\n## The checklist\n\n1. **Measure with real numbers.** Lighthouse and the Network tab answer\n most questions. If you're not measuring, you're guessing.\n2. **Serve fewer bytes.** Compress images (AVIF or WebP), remove unused\n fonts, and audit any dependency over 50KB gzipped.\n3. **Defer the non-critical.** Scripts that aren't needed above the\n fold can wait. `loading=\"lazy\"` on images, `defer` on scripts, and\n dynamic `import()` for interactive widgets.\n4. **Cache at the edge.** If the same HTML could serve a thousand users,\n it should. Use your adapter's cache headers; don't hand-roll it.\n5. **Avoid waterfalls.** If page load depends on three sequential fetches,\n collapse them into one endpoint or preload the critical ones.\n6. **Trust the framework.** SvelteKit's `load` functions run in parallel\n by default and the compiler already strips unused code. Most hand-rolled\n cleverness just gets in the way.\n\n## What we stopped worrying about\n\n- Micro-optimizations inside component code — the bundle is small, the\n diff is fast. The savings are real but rarely matter.\n- Third-party tooling that promises \"speed.\" If it adds a build step,\n the benefit needs to be measurable, not theoretical.\n\n## When to go deeper\n\nIf the checklist doesn't move the needle, the next step is almost\nalways a deeper look at the data layer — query plans, N+1 fetches, cold\ncache behavior. But you should have exhausted the list above before\ngetting there. Most slowness is boring, and most fixes are too.\n", Sc = "---\ntitle: Welcome to the Blog\ndescription: A quick note on what this space is for and what to expect from us.\ncreatedDate: 2026-04-20\ntags:\n - announcements\nauthor:\n name: Ada Chen\n---\n\nWelcome in. This blog is where we write about the things we build, the\ndecisions behind them, and what we learn when they go sideways.\n\nYou can expect a mix of short notes and longer walkthroughs. No schedule,\nno filler. If a post exists it's because something was worth writing down.\n\nA few threads you'll see pop up often:\n\n- Product notes on what we're shipping and why\n- Practical tutorials for the tools we use every day\n- Design and engineering decisions that took more than five minutes\n\nIf you'd rather not check back manually, the [RSS feed](/blog/rss.xml)\nhas every post. Thanks for reading.\n", Cc = "---\ntitle: Why We Chose Tailwind v4\ndescription: Notes on moving from a traditional CSS pipeline to Tailwind v4's zero-config, CSS-first setup.\ncreatedDate: 2026-02-18\ntags:\n - tailwind\n - design\nauthor:\n name: Ada Chen\n---\n\nTailwind v4 is a meaningful rewrite. The surface API still looks the same\n— utility classes on elements — but the compiler, configuration model,\nand theming story all changed in ways that made us want to adopt it.\n\n> The point of a design system isn't to ship fewer classes. It's to make\n> the next decision easier than the last.\n\n## What changed for us\n\nThree things mattered:\n\n1. **CSS-first config.** `tailwind.config.js` is gone. Tokens live in\n `app.css` as real CSS custom properties, which means they also work\n outside of Tailwind — SVG fills, inline styles, wherever.\n2. **OKLCH colors.** Designers can reason about lightness and chroma\n independently. Contrast checks become much easier to eyeball.\n3. **Speed.** The new engine compiles fast enough that we stopped\n thinking about purge lists. Dev feedback is effectively instant.\n\n## The config we kept\n\nWe pinned two things in `app.css`:\n\n```css\n@import 'tailwindcss';\n@plugin '@tailwindcss/typography';\n\n:root {\n --radius: 0.625rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.129 0.042 264.695);\n}\n```\n\nEverything else — spacing, typography, breakpoints — falls back to\ndefaults until we have a reason to override it.\n\n## What we'd tell a team evaluating it\n\nIf you're already using Tailwind v3, the migration is mostly a config\nmove. If you're starting from scratch, v4 removes a pile of decisions\nyou'd otherwise be making on day one. That alone made it worth it.\n", wc = "---\ntitle: Writing Posts with MDsveX\ndescription: How this blog turns markdown files into real Svelte components — frontmatter, code, and embedded UI.\ncreatedDate: 2026-01-28\nupdatedDate: 2026-02-02\ntags:\n - mdsvex\n - tutorial\nauthor:\n name: Priya Shah\n---\n\nPosts on this blog are `.svx` files. Each one is a real Svelte component\nat build time, so Markdown and Svelte sit side by side with no glue\ncode.\n\n## Frontmatter\n\nYAML at the top of a post becomes the `metadata` export. The loader\nreads it to build the list view, tag pages, and RSS feed.\n\n```yaml\n---\ntitle: Writing Posts with MDsveX\ndescription: A short description shown in previews.\ncreatedDate: 2026-01-28\ntags:\n - mdsvex\n - tutorial\nauthor:\n name: Priya Shah\n---\n```\n\n## Markdown works the way you'd expect\n\nHeadings, lists, links, blockquotes, and inline `code` all render.\nFenced code blocks pick up language hints for syntax highlighting when a\nplugin is enabled.\n\n```ts\nfunction greet(name: string) {\n return `hello, ${name}`;\n}\n```\n\n## Images\n\nPut images in `static/` and reference them with a root-relative path:\n\n```md\n\n```\n\n## Svelte in your posts\n\nThe superpower is that you can drop components straight into a post —\na chart, an interactive demo, a call-to-action card. The rules are the\nsame as any other Svelte file:\n\n```svelte\n<script>\n import Callout from '$lib/components/Callout.svelte';\n<\/script>\n\n<Callout>This is a real component inside a markdown post.</Callout>\n```\n\nThat's the whole pipeline. Write markdown, sprinkle in components when\nplain text stops being enough, and the rest is just Svelte.\n", Tc = "import type { Component } from \"svelte\";\n\nexport type BlogAuthor = {\n name: string;\n avatar?: string;\n};\n\nexport type BlogMetadata = {\n title: string;\n description: string;\n createdDate: string;\n updatedDate?: string;\n tags?: string[];\n author?: BlogAuthor;\n};\n\nexport type BlogModules = Record<\n string,\n { default: Component; metadata: BlogMetadata }\n>;\n\nexport type BlogRawModules = Record<string, string>;\n\nexport type BlogPost = {\n slug: string;\n title: string;\n description: string;\n createdDate: Date;\n updatedDate?: Date;\n tags?: string[];\n author?: BlogAuthor;\n readingTime: number;\n component: Component;\n};\n\nexport type BlogPostSummary = Omit<BlogPost, \"component\">;\n\nconst WORDS_PER_MINUTE = 220;\n\nfunction getBlogModules() {\n return import.meta.glob(\"$lib/content/blog/*.svx\", {\n eager: true,\n }) as BlogModules;\n}\n\nfunction getBlogRawModules() {\n return import.meta.glob(\"$lib/content/blog/*.svx\", {\n eager: true,\n query: \"?raw\",\n import: \"default\",\n }) as BlogRawModules;\n}\n\nfunction stripFrontmatter(raw: string) {\n if (!raw.startsWith(\"---\")) return raw;\n const end = raw.indexOf(\"\\n---\", 3);\n if (end === -1) return raw;\n return raw.slice(end + 4);\n}\n\nfunction computeReadingTime(raw: string) {\n const body = stripFrontmatter(raw);\n const words = body.split(/\\s+/).filter(Boolean).length;\n return Math.max(1, Math.ceil(words / WORDS_PER_MINUTE));\n}\n\nexport function getBlogPosts(): BlogPost[] {\n const modules = getBlogModules();\n const rawModules = getBlogRawModules();\n\n const posts = Object.entries(modules).map(([path, module]) => {\n const filename = path.split(\"/\").pop() ?? \"\";\n const slug = filename.replace(\".svx\", \"\");\n const raw = rawModules[path] ?? \"\";\n\n return {\n slug,\n title: module.metadata.title,\n description: module.metadata.description,\n createdDate: new Date(module.metadata.createdDate),\n updatedDate: module.metadata.updatedDate\n ? new Date(module.metadata.updatedDate)\n : undefined,\n tags: module.metadata.tags,\n author: module.metadata.author,\n readingTime: computeReadingTime(raw),\n component: module.default,\n };\n });\n\n posts.sort((a, b) => b.createdDate.getTime() - a.createdDate.getTime());\n return posts;\n}\n\nexport function getBlogPost(slug: string) {\n const posts = getBlogPosts();\n return posts.find((post) => post.slug === slug) ?? null;\n}\n\nexport function getBlogPostRaw(slug: string): string | null {\n const rawModules = getBlogRawModules();\n for (const [path, raw] of Object.entries(rawModules)) {\n const filename = path.split(\"/\").pop() ?? \"\";\n if (filename.replace(\".svx\", \"\") === slug) return raw;\n }\n return null;\n}\n\nexport function getBlogPostsByTag(tag: string) {\n return getBlogPosts().filter((post) => post.tags?.includes(tag));\n}\n\nexport function getAllTags(): { tag: string; count: number }[] {\n const counts = new Map<string, number>();\n for (const post of getBlogPosts()) {\n for (const tag of post.tags ?? []) {\n counts.set(tag, (counts.get(tag) ?? 0) + 1);\n }\n }\n return [...counts.entries()]\n .map(([tag, count]) => ({ tag, count }))\n .sort((a, b) => b.count - a.count || a.tag.localeCompare(b.tag));\n}\n\nexport function getAdjacentPosts(slug: string): {\n prev: BlogPost | null;\n next: BlogPost | null;\n} {\n const posts = getBlogPosts();\n const index = posts.findIndex((post) => post.slug === slug);\n if (index === -1) return { prev: null, next: null };\n return {\n next: index > 0 ? posts[index - 1] : null,\n prev: index < posts.length - 1 ? posts[index + 1] : null,\n };\n}\n\nexport function getRelatedPosts(slug: string, limit = 3): BlogPost[] {\n const posts = getBlogPosts();\n const current = posts.find((post) => post.slug === slug);\n if (!current?.tags?.length) return [];\n\n const currentTags = new Set(current.tags);\n\n return posts\n .filter((post) => post.slug !== slug && post.tags?.length)\n .map((post) => ({\n post,\n overlap: post.tags!.filter((tag) => currentTags.has(tag)).length,\n }))\n .filter(({ overlap }) => overlap > 0)\n .sort(\n (a, b) =>\n b.overlap - a.overlap ||\n b.post.createdDate.getTime() - a.post.createdDate.getTime(),\n )\n .slice(0, limit)\n .map(({ post }) => post);\n}\n", Ec = "const formatter = new Intl.DateTimeFormat(\"en-US\", {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n});\n\nexport function formatDate(date: Date) {\n return formatter.format(date);\n}\n", Dc = "<script lang=\"ts\">\n import * as Breadcrumb from \"$lib/components/ui/breadcrumb\";\n import { page } from \"$app/state\";\n\n let { children } = $props();\n\n let breadcrumbs = $derived(page.data.breadcrumbs || []) as {\n title: string;\n url: string;\n }[];\n<\/script>\n\n<section data-role=\"content\">\n <Breadcrumb.Root class=\"mb-6\">\n <Breadcrumb.List>\n {#if breadcrumbs.length > 1}\n {#each breadcrumbs.slice(0, -1) as breadcrumb}\n <Breadcrumb.Item>\n <Breadcrumb.Link href={breadcrumb.url}\n >{breadcrumb.title}</Breadcrumb.Link\n >\n </Breadcrumb.Item>\n <Breadcrumb.Separator />\n {/each}\n {/if}\n <Breadcrumb.Page>\n {breadcrumbs[breadcrumbs.length - 1].title}\n </Breadcrumb.Page>\n </Breadcrumb.List>\n </Breadcrumb.Root>\n\n {@render children?.()}\n</section>\n", Oc = "<script lang=\"ts\">\n import { Badge } from \"$lib/components/ui/badge\";\n import { Button } from \"$lib/components/ui/button\";\n import PostCard from \"$lib/components/blog/PostCard.svelte\";\n import Rss from \"@lucide/svelte/icons/rss\";\n\n let { data } = $props();\n<\/script>\n\n<div class=\"flex flex-col gap-10\">\n <header\n class=\"flex flex-col gap-4 md:flex-row md:items-end md:justify-between\"\n >\n <div class=\"max-w-2xl\">\n <h1 class=\"text-3xl font-semibold tracking-tight sm:text-4xl\">Blog</h1>\n <p class=\"text-muted-foreground mt-2 text-base\">\n Product notes, tutorials, and engineering posts from the team.\n </p>\n </div>\n <Button href=\"/blog/rss.xml\" variant=\"outline\" size=\"sm\" class=\"w-fit\">\n <Rss class=\"size-4\" />\n RSS\n </Button>\n </header>\n\n <ul class=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {#each data.blogPosts as post (post.slug)}\n <li class=\"flex w-full\">\n <PostCard {post} />\n </li>\n {/each}\n </ul>\n</div>\n", kc = "import { definePageMetaTags } from \"svelte-meta-tags\";\nimport { getAllTags, getBlogPosts } from \"$lib/content\";\n\nexport const load = async ({ parent }) => {\n await parent();\n\n const blogPosts = getBlogPosts();\n const allTags = getAllTags();\n\n const pageMetaTags = definePageMetaTags({\n title: \"Blog\",\n description: \"Product notes, tutorials, and engineering posts.\",\n });\n\n const breadcrumbs = [\n { title: \"Home\", url: \"/\" },\n { title: \"Blog\", url: \"/blog\" },\n ];\n\n return { blogPosts, allTags, breadcrumbs, ...pageMetaTags };\n};\n", Ac = "<script lang=\"ts\">\n import { Badge } from \"$lib/components/ui/badge\";\n import { Separator } from \"$lib/components/ui/separator\";\n import AuthorChip from \"$lib/components/blog/AuthorChip.svelte\";\n import PostCard from \"$lib/components/blog/PostCard.svelte\";\n import { formatDate } from \"$lib/utils/date\";\n import * as Breadcrumb from \"$lib/components/ui/breadcrumb\";\n import ArrowLeft from \"@lucide/svelte/icons/arrow-left\";\n import ArrowRight from \"@lucide/svelte/icons/arrow-right\";\n import { page } from \"$app/state\";\n\n let { data } = $props();\n let breadcrumbs = $derived(page.data.breadcrumbs || []) as {\n title: string;\n url: string;\n }[];\n<\/script>\n\n<div class=\"flex flex-col gap-6\">\n <header class=\"flex flex-col gap-5 border-b border-border pb-8\">\n <div class=\"flex flex-col gap-3\">\n <h1 class=\"text-3xl font-semibold tracking-tight sm:text-4xl\">\n {data.blogPost.title}\n </h1>\n <p class=\"text-muted-foreground text-lg\">\n {data.blogPost.description}\n </p>\n </div>\n\n <div\n class=\"text-muted-foreground flex flex-wrap items-center gap-x-1 gap-y-2 text-sm\"\n >\n {#if data.blogPost.author}\n <AuthorChip author={data.blogPost.author} />\n <span aria-hidden=\"true\" class=\"text-muted-foreground/50\">•</span>\n {/if}\n <time datetime={data.blogPost.createdDate.toISOString()}>\n {formatDate(data.blogPost.createdDate)}\n </time>\n {#if data.blogPost.updatedDate}\n <span aria-hidden=\"true\" class=\"text-muted-foreground/50\">•</span>\n <span>Updated {formatDate(data.blogPost.updatedDate)}</span>\n {/if}\n <span aria-hidden=\"true\" class=\"text-muted-foreground/50\">•</span>\n <span>{data.blogPost.readingTime} min read</span>\n </div>\n\n {#if data.blogPost.tags?.length}\n <div class=\"flex flex-wrap gap-1.5\">\n {#each data.blogPost.tags as tag (tag)}\n <Badge href={`/blog/tags/${tag}`} variant=\"secondary\">{tag}</Badge>\n {/each}\n </div>\n {/if}\n </header>\n\n <article\n class=\"prose dark:prose-invert max-w-prose prose-headings:mb-0 prose-headings:mt-4\"\n >\n <data.blogPost.component />\n </article>\n\n <Separator />\n\n <nav class=\"grid gap-3 sm:grid-cols-2\" aria-label=\"Post navigation\">\n {#if data.adjacent.prev}\n <a\n href={`/blog/${data.adjacent.prev.slug}`}\n class=\"ring-foreground/10 hover:ring-foreground/20 bg-card text-card-foreground group flex flex-col gap-1 rounded-xl p-4 ring-1 transition-shadow\"\n >\n <span\n class=\"text-muted-foreground inline-flex items-center gap-1 text-xs font-medium uppercase tracking-wide\"\n >\n <ArrowLeft class=\"size-3.5\" />\n Previous\n </span>\n <span class=\"font-medium group-hover:underline\"\n >{data.adjacent.prev.title}</span\n >\n </a>\n {:else}\n <div></div>\n {/if}\n\n {#if data.adjacent.next}\n <a\n href={`/blog/${data.adjacent.next.slug}`}\n class=\"ring-foreground/10 hover:ring-foreground/20 bg-card text-card-foreground group flex flex-col gap-1 rounded-xl p-4 text-right ring-1 transition-shadow sm:col-start-2\"\n >\n <span\n class=\"text-muted-foreground inline-flex items-center justify-end gap-1 text-xs font-medium uppercase tracking-wide\"\n >\n Next\n <ArrowRight class=\"size-3.5\" />\n </span>\n <span class=\"font-medium group-hover:underline\"\n >{data.adjacent.next.title}</span\n >\n </a>\n {/if}\n </nav>\n\n {#if data.related.length}\n <section class=\"flex flex-col gap-4\">\n <Separator />\n <h2 class=\"text-xl font-semibold tracking-tight\">Related posts</h2>\n <ul class=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {#each data.related as post (post.slug)}\n <li class=\"flex\">\n <PostCard {post} />\n </li>\n {/each}\n </ul>\n </section>\n {/if}\n</div>\n", jc = "import { error } from \"@sveltejs/kit\";\nimport { definePageMetaTags } from \"svelte-meta-tags\";\nimport {\n getAdjacentPosts,\n getBlogPost,\n getBlogPosts,\n getRelatedPosts,\n} from \"$lib/content\";\n\nexport const load = async ({ params, parent }) => {\n await parent();\n\n const blogPost = getBlogPost(params.slug);\n\n if (blogPost === null) {\n throw error(404, \"Page not found\");\n }\n\n const adjacent = getAdjacentPosts(params.slug);\n const related = getRelatedPosts(params.slug);\n\n const pageMetaTags = definePageMetaTags({\n title: blogPost.title,\n description: blogPost.description,\n });\n\n const breadcrumbs = [\n { title: \"Home\", url: \"/\" },\n { title: \"Blog\", url: \"/blog\" },\n { title: blogPost.title, url: `/blog/${blogPost.slug}` },\n ];\n\n return { blogPost, adjacent, related, breadcrumbs, ...pageMetaTags };\n};\n\nexport const entries = async () => {\n return getBlogPosts().map((post) => ({ slug: post.slug }));\n};\n", Mc = "import { getBlogPosts } from \"$lib/content\";\n\nexport const prerender = true;\n\nfunction escapeXml(value: string) {\n return value\n .replace(/&/g, \"&\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\");\n}\n\nexport const GET = async ({ locals, url }) => {\n const { appName } = locals.meta;\n const posts = getBlogPosts();\n // `url.origin`, not `locals.meta.appURL`: this feed is prerendered, and the\n // origin comes from the build's own configuration rather than from whichever\n // database the build could reach. Every `<link>` and `<guid>` below is\n // permanent once published, so pointing them at a developer's localhost is\n // not something a later deploy can take back.\n const siteURL = url.origin.replace(/\\/$/, \"\");\n const feedURL = `${siteURL}/blog/rss.xml`;\n const lastBuild = (\n posts[0]?.updatedDate ??\n posts[0]?.createdDate ??\n new Date()\n ).toUTCString();\n\n const items = posts\n .map((post) => {\n const link = `${siteURL}/blog/${post.slug}`;\n const pubDate = post.createdDate.toUTCString();\n const categories = (post.tags ?? [])\n .map((tag) => ` <category>${escapeXml(tag)}</category>`)\n .join(\"\\n\");\n const creator = post.author\n ? ` <dc:creator>${escapeXml(post.author.name)}</dc:creator>`\n : \"\";\n\n return [\n \" <item>\",\n ` <title>${escapeXml(post.title)}</title>`,\n ` <link>${escapeXml(link)}</link>`,\n ` <guid isPermaLink=\"true\">${escapeXml(link)}</guid>`,\n ` <description>${escapeXml(post.description)}</description>`,\n ` <pubDate>${pubDate}</pubDate>`,\n creator,\n categories,\n \" </item>\",\n ]\n .filter(Boolean)\n .join(\"\\n\");\n })\n .join(\"\\n\");\n\n const xml = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n<channel>\n <title>${escapeXml(appName)}</title>\n <link>${escapeXml(`${siteURL}/blog`)}</link>\n <atom:link href=\"${escapeXml(feedURL)}\" rel=\"self\" type=\"application/rss+xml\" />\n <description>${escapeXml(`Latest posts from ${appName}.`)}</description>\n <language>en</language>\n <lastBuildDate>${lastBuild}</lastBuildDate>\n${items}\n</channel>\n</rss>\n`;\n\n return new Response(xml, {\n headers: {\n \"Content-Type\": \"application/xml; charset=utf-8\",\n \"Cache-Control\": \"max-age=0, s-maxage=3600\",\n },\n });\n};\n", Nc = "<script lang=\"ts\">\n import { Badge } from \"$lib/components/ui/badge\";\n\n let { data } = $props();\n<\/script>\n\n<div class=\"flex flex-col gap-8\">\n <header class=\"flex flex-col gap-2\">\n <h1 class=\"text-3xl font-semibold tracking-tight sm:text-4xl\">Tags</h1>\n <p class=\"text-muted-foreground text-base\">\n {data.allTags.length}\n {data.allTags.length === 1 ? \"tag\" : \"tags\"} used across the blog.\n </p>\n </header>\n\n {#if data.allTags.length}\n <ul class=\"flex flex-wrap gap-2\">\n {#each data.allTags as { tag, count } (tag)}\n <li>\n <Badge href={`/blog/tags/${tag}`} variant=\"secondary\">\n {tag}\n <span class=\"text-muted-foreground ml-0.5\">{count}</span>\n </Badge>\n </li>\n {/each}\n </ul>\n {:else}\n <p class=\"text-muted-foreground\">No tags yet.</p>\n {/if}\n</div>\n", Pc = "import { definePageMetaTags } from \"svelte-meta-tags\";\nimport { getAllTags } from \"$lib/content\";\n\nexport const load = async ({ parent }) => {\n await parent();\n\n const allTags = getAllTags();\n\n const pageMetaTags = definePageMetaTags({\n title: \"Tags\",\n description: \"All tags used on the blog.\",\n });\n\n const breadcrumbs = [\n { title: \"Home\", url: \"/\" },\n { title: \"Blog\", url: \"/blog\" },\n { title: \"Tags\", url: \"/blog/tags\" },\n ];\n\n return { allTags, breadcrumbs, ...pageMetaTags };\n};\n", Fc = "<script lang=\"ts\">\n import PostCard from \"$lib/components/blog/PostCard.svelte\";\n\n let { data } = $props();\n<\/script>\n\n<div class=\"flex flex-col gap-8\">\n <header class=\"flex flex-col gap-2\">\n <h1 class=\"text-3xl font-semibold tracking-tight sm:text-4xl\">\n {data.tag}\n </h1>\n <p class=\"text-muted-foreground text-base\">\n {data.blogPosts.length}\n {data.blogPosts.length === 1 ? \"post\" : \"posts\"} tagged \"{data.tag}\".\n </p>\n </header>\n\n <ul class=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {#each data.blogPosts as post (post.slug)}\n <li class=\"flex\">\n <PostCard {post} />\n </li>\n {/each}\n </ul>\n</div>\n", Ic = "import { error } from \"@sveltejs/kit\";\nimport { definePageMetaTags } from \"svelte-meta-tags\";\nimport { getAllTags, getBlogPostsByTag } from \"$lib/content\";\n\nexport const load = async ({ params, parent }) => {\n await parent();\n\n const blogPosts = getBlogPostsByTag(params.tag);\n\n if (blogPosts.length === 0) {\n throw error(404, \"Tag not found\");\n }\n\n const pageMetaTags = definePageMetaTags({\n title: `Posts tagged \"${params.tag}\"`,\n description: `Blog posts tagged \"${params.tag}\".`,\n });\n\n const breadcrumbs = [\n { title: \"Home\", url: \"/\" },\n { title: \"Blog\", url: \"/blog\" },\n { title: \"Tags\", url: \"/blog/tags\" },\n { title: params.tag, url: `/blog/tags/${params.tag}` },\n ];\n\n return { blogPosts, tag: params.tag, breadcrumbs, ...pageMetaTags };\n};\n\nexport const entries = async () => {\n return getAllTags().map(({ tag }) => ({ tag }));\n};\n", Lc = "import { negotiate } from \"$lib/negotiate\";\nimport { getBlogPostRaw } from \"$lib/content\";\n\nexport const load = async ({ params, locals }) => {\n return {\n ...negotiate(locals, {\n \"text/markdown\": () => getBlogPostRaw(params.slug) ?? \"\",\n }),\n };\n};\n", Rc = /* #__PURE__ */ Object.assign({
|
|
4670
4670
|
"./creates/src/css/prism-vsc-dark-plus.css": gc,
|
|
4671
4671
|
"./creates/src/lib/components/blog/AuthorChip.svelte": _c,
|
|
4672
4672
|
"./creates/src/lib/components/blog/PostCard.svelte": vc,
|