@grove-dev/cli 0.19.0 → 1.0.1

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/r/home.json CHANGED
@@ -61,14 +61,14 @@
61
61
  },
62
62
  {
63
63
  "path": "default/components/grove/hero-proof.astro",
64
- "content": "---\n/**\n * HeroProof — the proof row under the home hero, and the \"featured in\"\n * pill for its eyebrow.\n *\n * `variant=\"pill\"` renders the newest `site.press` mention as a link\n * for the hero's `eyebrow` slot. `variant=\"row\"` renders contributor\n * faces and count, the site repository's stars and the newest mention.\n * Every value comes from site-config.json; parts with no data are left\n * out, so a new site shows nothing rather than zeros.\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport { compact } from '@grove-dev/core';\n\ninterface Props {\n variant: 'pill' | 'row';\n /** Contributors for the faces (the home model's `contributors`). */\n contributors?: Array<{ username: string; avatarUrl?: string }>;\n slot?: string;\n}\n\nconst { variant, contributors = [] } = Astro.props;\ntype Press = { outlet: string; title: string; url: string; date: string; label?: string; logo?: string };\nconst site = siteConfig as {\n press?: Press[];\n repoUrl?: string;\n stats?: { repositoryStars?: number; repositoryContributors?: number };\n};\nconst featured = site.press?.[0];\nconst stars = site.stats?.repositoryStars ?? 0;\nconst people = site.stats?.repositoryContributors || contributors.length;\nconst faces = contributors.filter((c) => c.avatarUrl).slice(0, 5);\nconst monthYear = (date: string) =>\n new Date(`${date}-01T00:00:00Z`).toLocaleDateString('en-US', { month: 'long', year: 'numeric', timeZone: 'UTC' });\n---\n\n{variant === 'pill' ? (\n featured && (\n <a\n href={featured.url}\n target=\"_blank\"\n rel=\"noopener\"\n class=\"group inline-flex items-center gap-2 rounded-full border border-border bg-secondary py-1 pl-1.5 pr-3 text-[13px] font-medium text-secondary-foreground no-underline transition-colors hover:border-ink-400 dark:hover:border-ink-600\"\n data-event=\"press_click\"\n data-event-source=\"hero_eyebrow\"\n data-event-item={featured.outlet}\n >\n {featured.logo ? (\n <span class=\"inline-flex h-5 w-5 items-center justify-center rounded-full bg-white p-0.5\"><img src={featured.logo} alt=\"\" width=\"14\" height=\"14\" class=\"h-3.5 w-3.5\" /></span>\n ) : (\n <span aria-hidden=\"true\" class=\"inline-block h-1.5 w-1.5 rounded-full bg-success\"></span>\n )}\n {featured.label ?? `Featured in ${featured.outlet} · ${monthYear(featured.date)}`}\n <span aria-hidden=\"true\" class=\"text-muted-foreground transition-transform group-hover:translate-x-0.5\">→</span>\n </a>\n )\n) : (\n (faces.length > 0 || stars > 0 || featured) && (\n <div class=\"mt-8 flex flex-wrap items-center justify-center gap-x-6 gap-y-3 text-[13px] text-ink-500 dark:text-ink-400\">\n {faces.length > 0 && (\n <a href=\"/contributors/\" class=\"inline-flex items-center gap-2.5 text-inherit no-underline hover:text-foreground\">\n <span class=\"flex -space-x-2\" aria-hidden=\"true\">\n {faces.map((c) => (\n <img src={`${c.avatarUrl}${c.avatarUrl!.includes('?') ? '&' : '?'}s=48`} alt=\"\" width=\"24\" height=\"24\" loading=\"lazy\" decoding=\"async\" class=\"h-6 w-6 rounded-full border-2 border-background\" />\n ))}\n </span>\n <span><strong class=\"font-semibold text-foreground\">{people}</strong> contributors</span>\n </a>\n )}\n {stars > 0 && site.repoUrl && (\n <a href={site.repoUrl} target=\"_blank\" rel=\"noopener\" class=\"inline-flex items-center gap-1.5 text-inherit no-underline hover:text-foreground\">\n <svg viewBox=\"0 0 16 16\" width=\"13\" height=\"13\" aria-hidden=\"true\" fill=\"currentColor\" class=\"text-warning\"><path d=\"M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Z\"></path></svg>\n <span><strong class=\"font-semibold text-foreground\">{compact(stars)}</strong> stars on GitHub</span>\n </a>\n )}\n {featured && (\n <a href={featured.url} target=\"_blank\" rel=\"noopener\" class=\"inline-flex items-center gap-1.5 text-inherit no-underline hover:text-foreground\" data-event=\"press_click\" data-event-source=\"hero_proof\" data-event-item={featured.outlet}>\n {featured.logo && <span class=\"inline-flex h-4 w-4 items-center justify-center rounded-full bg-white p-px\"><img src={featured.logo} alt=\"\" width=\"12\" height=\"12\" class=\"h-3 w-3\" /></span>}\n <span>Featured by <strong class=\"font-semibold text-foreground\">{featured.outlet}</strong></span>\n </a>\n )}\n </div>\n )\n)}\n",
64
+ "content": "---\n/**\n * HeroProof — the proof row under the home hero, and the \"featured in\"\n * pill for its eyebrow.\n *\n * `variant=\"pill\"` renders the newest `site.press` mention as a link\n * for the hero's `eyebrow` slot. `variant=\"row\"` renders contributor\n * faces and count, the site repository's stars and the newest mention.\n * Every value comes from site-config.json; parts with no data are left\n * out, so a new site shows nothing rather than zeros.\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport { compact } from '@grove-dev/core';\n\ninterface Props {\n variant: 'pill' | 'row';\n /** Contributors for the faces (the home model's `contributors`). */\n contributors?: Array<{ username: string; avatarUrl?: string }>;\n slot?: string;\n}\n\nconst { variant, contributors = [] } = Astro.props;\ntype Press = {\n outlet: string;\n title: string;\n url: string;\n date: string;\n label?: string;\n logo?: string;\n};\nconst site = siteConfig as {\n press?: Press[];\n repoUrl?: string;\n stats?: { repositoryStars?: number; repositoryContributors?: number };\n};\nconst featured = site.press?.[0];\nconst stars = site.stats?.repositoryStars ?? 0;\nconst people = site.stats?.repositoryContributors || contributors.length;\nconst faces = contributors.filter((c) => c.avatarUrl).slice(0, 5);\nconst monthYear = (date: string) =>\n new Date(`${date}-01T00:00:00Z`).toLocaleDateString('en-US', {\n month: 'long',\n year: 'numeric',\n timeZone: 'UTC',\n });\n---\n\n{variant === 'pill' ? (\n featured && (\n <a\n href={featured.url}\n target=\"_blank\"\n rel=\"noopener\"\n class=\"group inline-flex items-center gap-2 rounded-full border border-border bg-secondary py-1 pl-1.5 pr-3 text-[13px] font-medium text-secondary-foreground no-underline transition-colors hover:border-ink-400 dark:hover:border-ink-600\"\n data-event=\"press_click\"\n data-event-source=\"hero_eyebrow\"\n data-event-item={featured.outlet}\n >\n {featured.logo ? (\n <span class=\"inline-flex h-5 w-5 items-center justify-center rounded-full bg-white p-0.5\"><img src={featured.logo} alt=\"\" width=\"14\" height=\"14\" class=\"h-3.5 w-3.5\" /></span>\n ) : (\n <span aria-hidden=\"true\" class=\"inline-block h-1.5 w-1.5 rounded-full bg-success\"></span>\n )}\n {featured.label ?? `Featured in ${featured.outlet} · ${monthYear(featured.date)}`}\n <span aria-hidden=\"true\" class=\"text-muted-foreground transition-transform group-hover:translate-x-0.5\">→</span>\n </a>\n )\n) : (\n (faces.length > 0 || stars > 0 || featured) && (\n <div class=\"mt-8 flex flex-wrap items-center justify-center gap-x-6 gap-y-3 text-[13px] text-ink-500 dark:text-ink-400\">\n {faces.length > 0 && (\n <a href=\"/contributors/\" class=\"inline-flex items-center gap-2.5 text-inherit no-underline hover:text-foreground\">\n <span class=\"flex -space-x-2\" aria-hidden=\"true\">\n {faces.map((c) => (\n <img src={`${c.avatarUrl}${c.avatarUrl!.includes('?') ? '&' : '?'}s=48`} alt=\"\" width=\"24\" height=\"24\" loading=\"lazy\" decoding=\"async\" class=\"h-6 w-6 rounded-full border-2 border-background\" />\n ))}\n </span>\n <span><strong class=\"font-semibold text-foreground\">{people}</strong> contributors</span>\n </a>\n )}\n {stars > 0 && site.repoUrl && (\n <a href={site.repoUrl} target=\"_blank\" rel=\"noopener\" class=\"inline-flex items-center gap-1.5 text-inherit no-underline hover:text-foreground\">\n <svg viewBox=\"0 0 16 16\" width=\"13\" height=\"13\" aria-hidden=\"true\" fill=\"currentColor\" class=\"text-warning\"><path d=\"M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Z\"></path></svg>\n <span><strong class=\"font-semibold text-foreground\">{compact(stars)}</strong> stars on GitHub</span>\n </a>\n )}\n {featured && (\n <a href={featured.url} target=\"_blank\" rel=\"noopener\" class=\"inline-flex items-center gap-1.5 text-inherit no-underline hover:text-foreground\" data-event=\"press_click\" data-event-source=\"hero_proof\" data-event-item={featured.outlet}>\n {featured.logo && <span class=\"inline-flex h-4 w-4 items-center justify-center rounded-full bg-white p-px\"><img src={featured.logo} alt=\"\" width=\"12\" height=\"12\" class=\"h-3 w-3\" /></span>}\n <span>Featured by <strong class=\"font-semibold text-foreground\">{featured.outlet}</strong></span>\n </a>\n )}\n </div>\n )\n)}\n",
65
65
  "type": "registry:component",
66
66
  "target": "~/src/components/grove/hero-proof.astro"
67
67
  }
68
68
  ],
69
69
  "meta": {
70
- "version": "1.4.0",
71
- "requiresGrove": "0.19.0"
70
+ "version": "1.5.0",
71
+ "requiresGrove": "1.0.1"
72
72
  },
73
73
  "type": "registry:block"
74
74
  }
@@ -16,8 +16,8 @@
16
16
  }
17
17
  ],
18
18
  "meta": {
19
- "version": "1.4.0",
20
- "requiresGrove": "0.19.0"
19
+ "version": "1.5.0",
20
+ "requiresGrove": "1.0.1"
21
21
  },
22
22
  "type": "registry:block"
23
23
  }
@@ -24,7 +24,7 @@
24
24
  },
25
25
  {
26
26
  "path": "default/components/grove/icon.astro",
27
- "content": "---\nimport type { IconKind } from '../../lib/icon-kinds';\n/**\n * Icon — brand icon registry.\n *\n * Resolves a registry name to `/icons/{stacks|platforms|brands}/{name}.svg`\n * and renders it. The Astro integration syncs the packaged set into the\n * consumer's `public/icons/` on every build; consumers can ship their own\n * SVGs under the same paths (or override the `base` prop) without forking\n * this component.\n *\n * The component is **generic** — it does not import any consumer-side\n * `siteConfig`, `item`, or blueprint-specific module.\n *\n * `category` selects the subfolder:\n *\n * - \"stack\" → `/icons/stacks/{name}.svg`\n * - \"platform\" → `/icons/platforms/{name}.svg`\n * - \"brand\" → `/icons/brands/{name}.svg` (consumer-supplied)\n *\n * ## Theming\n *\n * `ICON_KINDS` (generated by `scripts/sync-icons.mjs`) classifies each\n * packaged icon:\n *\n * - **color** — the default. Any brand with a color mark keeps it,\n * rendered as `<img>` with an `onerror` fallback to an initials\n * chip.\n * - **mono** — marks with no color to lose (Apple, Rust, Tauri,\n * Solidity, Deno) plus the concept glyphs. Rendered as a CSS-masked\n * `<span>` painted from `--grove-foreground`, which reproduces how\n * those brands are actually used: solid black on light, solid white\n * on dark, with no script and no second file. See\n * `.grove-icon-mask` in `styles.css`.\n *\n * The map CLASSIFIES; it does not gate availability. A name it has never\n * heard of — a consumer's own SVG — takes the `<img>` path, exactly as\n * before. Pass `kind=\"mono\"` to opt a custom mark into `currentColor`\n * tinting.\n *\n * Aliases: a tiny `aliases` map (e.g. `rn → react-native`) lets the\n * registry accept multiple ids for the same asset. Lookup falls through\n * `aliases` → the built-in stack aliases → the raw slug, then fails over\n * to the initials placeholder.\n */\nimport { ICON_KINDS } from '../../lib/icon-kinds';\nimport type { IconCategory } from '../../lib/icon-registry';\nimport { resolveIconAsset, slugifyIconName } from '../../lib/icon-registry';\n\nexport type { IconCategory, IconKind };\n\n/**\n * @deprecated Theme variants are no longer file-based — `mono` icons\n * inherit `currentColor`. Accepted and ignored so consumers passing\n * `mode=\"auto\"` do not hit a type error.\n */\nexport type IconMode = 'static' | 'auto';\n\ninterface Props {\n /**\n * Registry id. Resolved through `aliases` first, then matched\n * against the SVG file name (case-insensitive, slug-normalized).\n */\n name: string;\n /** Subfolder under `/icons/`. */\n category: IconCategory;\n /** Pixel size (square). Defaults to 16. */\n size?: number;\n /** Extra class for the outer wrapper. */\n class?: string;\n /** Tooltip / aria-label. */\n title?: string;\n /** @deprecated No-op. Kept for one minor release. */\n mode?: IconMode;\n /**\n * Override the packaged kind classification. Pass `\"mono\"` for a\n * consumer-supplied single-color mark so it is painted black on\n * light and white on dark instead of shipping two files.\n */\n kind?: IconKind;\n /**\n * Optional id → id remap. Lookup goes `name → aliases[name] →\n * {name}.svg` (case-insensitive).\n */\n aliases?: Record<string, string>;\n /**\n * Optional complete asset registry supplied by a consumer. When omitted,\n * Grove attempts the configured asset path and falls back on image error.\n */\n available?: string[];\n /**\n * Initials to render when the icon file is missing. Defaults to\n * the first 1–2 characters of `name`.\n */\n fallbackInitials?: string;\n /**\n * Base path for icon files. Defaults to `/icons` (matches the\n * synced `public/icons/`).\n */\n base?: string;\n}\n\nconst {\n name,\n category,\n size = 16,\n class: className = '',\n title,\n kind,\n aliases,\n available,\n fallbackInitials,\n base = '/icons',\n} = Astro.props;\n\nconst asset = resolveIconAsset(name, category, aliases);\nconst resolved = asset.name;\nconst availableIcons = available?.map(slugifyIconName);\nconst hasAsset =\n category === 'brand' || availableIcons === undefined || availableIcons.includes(resolved);\nconst src = `${base.replace(/\\/$/, '')}/${asset.folder}/${resolved}.svg`;\n\n// Initials fallback: first 1–2 alphanumerics, uppercased.\nconst init = (fallbackInitials ?? name ?? '')\n .replace(/[^a-z0-9]/gi, '')\n .slice(0, 2)\n .toUpperCase();\nconst showFallback = !resolved || !hasAsset || asset.textOnly;\n\n// Unknown names fall through to `<img>`, never to `mono` — a mask has\n// no `onerror`, so a missing file would render an invisible blank.\nconst effectiveKind: IconKind = kind ?? ICON_KINDS[asset.key] ?? 'color';\n\n// `name` reaches the mask branch as part of a CSS `url()` token, and\n// slugifying does not remove the characters that would close it. Astro\n// escapes the attribute; this escapes the CSS inside it.\nconst cssUrl = src.replace(/['\"()\\\\\\s]/g, encodeURIComponent);\n\n// Build aria-label.\nconst ariaLabel = title ?? name;\nconst a11y: Record<string, string> = title\n ? { 'aria-label': ariaLabel, role: 'img' }\n : { 'aria-hidden': 'true', focusable: 'false' };\n\nconst fallbackClass = [\n 'inline-flex shrink-0 select-none items-center justify-center rounded-sm bg-ink-100 align-middle font-semibold uppercase leading-none text-ink-700 dark:bg-ink-800 dark:text-ink-200',\n className,\n];\nconst fallbackStyle = `width:${size}px;height:${size}px;font-size:${Math.max(10, size - 6)}px;`;\n---\n\n{\n showFallback ? (\n <span class:list={fallbackClass} style={fallbackStyle} {...a11y}>\n {init || \"·\"}\n </span>\n ) : effectiveKind === \"mono\" ? (\n <span\n class:list={[\"grove-icon-mask\", className]}\n style={`width:${size}px;height:${size}px;--grove-icon-url:url('${cssUrl}');`}\n {...a11y}\n />\n ) : (\n <>\n {/* The `width`/`height` attributes below are only presentational\n hints. These SVGs carry a `viewBox` and no intrinsic size, so\n once one loads the browser re-derives the box and the row\n reflows — Lighthouse reports it as \"media element lacking an\n explicit size\" and it cost the browse page 0.115 CLS. The\n `style` attribute's explicit CSS size pins the box before\n the first byte arrives. */}\n <img\n src={src}\n width={size}\n height={size}\n style={`width:${size}px;height:${size}px`}\n alt=\"\"\n class:list={[\"inline-block shrink-0 align-middle\", className]}\n loading=\"lazy\"\n decoding=\"async\"\n onerror=\"this.hidden=true;this.nextElementSibling.hidden=false\"\n {...a11y}\n />\n <span hidden data-grove-icon-fallback-initials class:list={fallbackClass} style={fallbackStyle} {...a11y}>\n {init || \"·\"}\n </span>\n </>\n )\n}\n",
27
+ "content": "---\nimport type { IconKind } from '../../lib/icon-kinds';\n/**\n * Icon — brand icon registry.\n *\n * Resolves a registry name to `/icons/{stacks|platforms|brands}/{name}.svg`\n * and renders it. The Astro integration syncs the packaged set into the\n * consumer's `public/icons/` on every build; consumers can ship their own\n * SVGs under the same paths (or override the `base` prop) without forking\n * this component.\n *\n * The component is **generic** — it does not import any consumer-side\n * `siteConfig`, `item`, or blueprint-specific module.\n *\n * `category` selects the subfolder:\n *\n * - \"stack\" → `/icons/stacks/{name}.svg`\n * - \"platform\" → `/icons/platforms/{name}.svg`\n * - \"brand\" → `/icons/brands/{name}.svg` (consumer-supplied)\n *\n * ## Theming\n *\n * `ICON_KINDS` (generated by `scripts/sync-icons.mjs`) classifies each\n * packaged icon:\n *\n * - **color** — the default. Any brand with a color mark keeps it,\n * rendered as `<img>` with an `onerror` fallback to an initials\n * chip.\n * - **mono** — marks with no color to lose (Apple, Rust, Tauri,\n * Solidity, Deno) plus the concept glyphs. Rendered as a CSS-masked\n * `<span>` painted from `--grove-foreground`, which reproduces how\n * those brands are actually used: solid black on light, solid white\n * on dark, with no script and no second file. See\n * `.grove-icon-mask` in `styles.css`.\n *\n * The map CLASSIFIES; it does not gate availability. A name it has never\n * heard of — a consumer's own SVG — takes the `<img>` path, exactly as\n * before. Pass `kind=\"mono\"` to opt a custom mark into `currentColor`\n * tinting.\n *\n * Aliases: a tiny `aliases` map (e.g. `rn → react-native`) lets the\n * registry accept multiple ids for the same asset. Lookup falls through\n * `aliases` → the built-in stack aliases → the raw slug, then fails over\n * to the initials placeholder.\n */\nimport { ICON_KINDS } from '../../lib/icon-kinds';\nimport type { IconCategory } from '../../lib/icon-registry';\nimport { resolveIconAsset, slugifyIconName } from '../../lib/icon-registry';\n\nexport type { IconCategory, IconKind };\n\ninterface Props {\n /**\n * Registry id. Resolved through `aliases` first, then matched\n * against the SVG file name (case-insensitive, slug-normalized).\n */\n name: string;\n /** Subfolder under `/icons/`. */\n category: IconCategory;\n /** Pixel size (square). Defaults to 16. */\n size?: number;\n /** Extra class for the outer wrapper. */\n class?: string;\n /** Tooltip / aria-label. */\n title?: string;\n /**\n * Override the packaged kind classification. Pass `\"mono\"` for a\n * consumer-supplied single-color mark so it is painted black on\n * light and white on dark instead of shipping two files.\n */\n kind?: IconKind;\n /**\n * Optional id → id remap. Lookup goes `name → aliases[name] →\n * {name}.svg` (case-insensitive).\n */\n aliases?: Record<string, string>;\n /**\n * Optional complete asset registry supplied by a consumer. When omitted,\n * Grove attempts the configured asset path and falls back on image error.\n */\n available?: string[];\n /**\n * Initials to render when the icon file is missing. Defaults to\n * the first 1–2 characters of `name`.\n */\n fallbackInitials?: string;\n /**\n * Base path for icon files. Defaults to `/icons` (matches the\n * synced `public/icons/`).\n */\n base?: string;\n}\n\nconst {\n name,\n category,\n size = 16,\n class: className = '',\n title,\n kind,\n aliases,\n available,\n fallbackInitials,\n base = '/icons',\n} = Astro.props;\n\nconst asset = resolveIconAsset(name, category, aliases);\nconst resolved = asset.name;\nconst availableIcons = available?.map(slugifyIconName);\nconst hasAsset =\n category === 'brand' || availableIcons === undefined || availableIcons.includes(resolved);\nconst src = `${base.replace(/\\/$/, '')}/${asset.folder}/${resolved}.svg`;\n\n// Initials fallback: first 1–2 alphanumerics, uppercased.\nconst init = (fallbackInitials ?? name ?? '')\n .replace(/[^a-z0-9]/gi, '')\n .slice(0, 2)\n .toUpperCase();\nconst showFallback = !resolved || !hasAsset || asset.textOnly;\n\n// Unknown names fall through to `<img>`, never to `mono` — a mask has\n// no `onerror`, so a missing file would render an invisible blank.\nconst effectiveKind: IconKind = kind ?? ICON_KINDS[asset.key] ?? 'color';\n\n// `name` reaches the mask branch as part of a CSS `url()` token, and\n// slugifying does not remove the characters that would close it. Astro\n// escapes the attribute; this escapes the CSS inside it.\nconst cssUrl = src.replace(/['\"()\\\\\\s]/g, encodeURIComponent);\n\n// Build aria-label.\nconst ariaLabel = title ?? name;\nconst a11y: Record<string, string> = title\n ? { 'aria-label': ariaLabel, role: 'img' }\n : { 'aria-hidden': 'true', focusable: 'false' };\n\nconst fallbackClass = [\n 'inline-flex shrink-0 select-none items-center justify-center rounded-sm bg-ink-100 align-middle font-semibold uppercase leading-none text-ink-700 dark:bg-ink-800 dark:text-ink-200',\n className,\n];\nconst fallbackStyle = `width:${size}px;height:${size}px;font-size:${Math.max(10, size - 6)}px;`;\n---\n\n{\n showFallback ? (\n <span class:list={fallbackClass} style={fallbackStyle} {...a11y}>\n {init || \"·\"}\n </span>\n ) : effectiveKind === \"mono\" ? (\n <span\n class:list={[\"grove-icon-mask\", className]}\n style={`width:${size}px;height:${size}px;--grove-icon-url:url('${cssUrl}');`}\n {...a11y}\n />\n ) : (\n <>\n {/* The `width`/`height` attributes below are only presentational\n hints. These SVGs carry a `viewBox` and no intrinsic size, so\n once one loads the browser re-derives the box and the row\n reflows — Lighthouse reports it as \"media element lacking an\n explicit size\" and it cost the browse page 0.115 CLS. The\n `style` attribute's explicit CSS size pins the box before\n the first byte arrives. */}\n <img\n src={src}\n width={size}\n height={size}\n style={`width:${size}px;height:${size}px`}\n alt=\"\"\n class:list={[\"inline-block shrink-0 align-middle\", className]}\n loading=\"lazy\"\n decoding=\"async\"\n onerror=\"this.hidden=true;this.nextElementSibling.hidden=false\"\n {...a11y}\n />\n <span hidden data-grove-icon-fallback-initials class:list={fallbackClass} style={fallbackStyle} {...a11y}>\n {init || \"·\"}\n </span>\n </>\n )\n}\n",
28
28
  "type": "registry:component",
29
29
  "target": "~/src/components/grove/icon.astro"
30
30
  },
@@ -42,8 +42,8 @@
42
42
  }
43
43
  ],
44
44
  "meta": {
45
- "version": "1.4.0",
46
- "requiresGrove": "0.19.0"
45
+ "version": "1.5.0",
46
+ "requiresGrove": "1.0.1"
47
47
  },
48
48
  "type": "registry:block"
49
49
  }
@@ -17,13 +17,13 @@
17
17
  },
18
18
  {
19
19
  "path": "default/components/grove/record-header.astro",
20
- "content": "---\n/**\n * RecordHeader.astro\n *\n * Compact project-identity header used at the top of every record\n * detail page. The header carries:\n * - avatar / initials\n * - pills row (category + curation labels + \"Curated\" check +\n * optional activity badge)\n * - record name + owner/repo line\n * - short description\n * - GitHub + Homepage CTAs\n *\n * Tags + activity metadata are surfaced separately (sidebar), so\n * the header stays narrow on mobile and doesn't compete with the\n * two-column layout below.\n *\n * Tone classes for the activity badge are static `[data-activity-tone]`\n * selectors in `styles.css` — Tailwind purges any classes built from\n * dynamic strings, so the package ships the rules statically and\n * the badge's `data-activity-tone` attribute picks one at runtime.\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport type { RecordDetailModel } from '@grove-dev/astro/server';\nimport { withRef } from '@grove-dev/core';\nimport { buttonClass } from '../../lib/classnames.ts';\n\ninterface Props {\n detail: RecordDetailModel;\n}\n\nconst { detail } = Astro.props;\nconst {\n record,\n repoUrl,\n homepageUrl,\n ownerRepo,\n avatarSrc,\n initials,\n curationLabels,\n activityBadge,\n summary,\n sourceDescription,\n screenshots,\n category,\n name,\n} = detail;\n// Links to the record's own site carry `ref=<site host>`; see `outbound`\n// in grove.config.ts.\nconst outbound = (siteConfig as { outbound?: { ref?: string | false; skipHosts?: string[] } }).outbound ?? {};\nconst homepageHref = withRef(homepageUrl, outbound);\nconst submittedBy = (record as { submittedBy?: string }).submittedBy;\n---\n\n<header class=\"mb-8\">\n {/* Identity row: logo sized to the name+repo block beside it — no\n tall avatar column leaving dead space under the logo. Pills sit\n at the row's right edge on wide viewports and wrap below on\n mobile. */}\n <div class=\"flex items-center gap-4\">\n {/* Initials stay in the DOM behind the logo and are revealed by the\n image's own `onerror` — a dead logo URL or a renamed GitHub org\n would otherwise render the broken-image glyph. */}\n {avatarSrc && (\n <img\n src={avatarSrc}\n alt=\"\"\n width=\"56\"\n height=\"56\"\n loading=\"lazy\"\n decoding=\"async\"\n onerror=\"this.hidden=true;this.nextElementSibling.hidden=false\"\n class=\"h-12 w-12 shrink-0 rounded-lg border border-ink-200 object-contain bg-white p-1 dark:border-ink-800 sm:h-14 sm:w-14\"\n />\n )}\n <span\n aria-hidden=\"true\"\n hidden={Boolean(avatarSrc)}\n data-grove-card-fallback-initials\n class=\"inline-flex h-12 w-12 shrink-0 items-center justify-center rounded-lg border border-ink-200 bg-ink-50 text-xl font-semibold text-ink-700 dark:border-ink-800 dark:bg-ink-900 dark:text-ink-200 sm:h-14 sm:w-14\"\n >\n {initials || \"·\"}\n </span>\n\n <div class=\"min-w-0 flex-1\">\n <h1 class=\"m-0 text-[1.75rem] font-semibold leading-tight tracking-tight text-ink-900 dark:text-ink-100 sm:text-[2rem]\">\n {name}\n </h1>\n {ownerRepo && (\n <p class=\"m-0 mt-0.5 text-sm text-ink-500 dark:text-ink-400\">\n <a\n href={`https://github.com/${ownerRepo.owner}`}\n target=\"_blank\"\n rel=\"noopener\"\n class=\"text-inherit no-underline hover:text-ink-900 dark:hover:text-ink-100\"\n >\n @{ownerRepo.owner}\n </a>\n <span class=\"mx-1 text-ink-300 dark:text-ink-700\">/</span>\n <a\n href={repoUrl}\n target=\"_blank\"\n rel=\"noopener\"\n class=\"text-inherit no-underline hover:text-ink-900 dark:hover:text-ink-100\"\n >\n {ownerRepo.repo}\n </a>\n </p>\n )}\n </div>\n\n {/* Pills — right-aligned beside the name on wide viewports. */}\n <div class=\"hidden shrink-0 flex-wrap items-center justify-end gap-1.5 md:flex\">\n {category && (\n <span class=\"rounded-full border border-ink-200 px-2 py-0.5 text-2xs font-medium text-ink-700 dark:border-ink-800 dark:text-ink-300\">\n {category}\n </span>\n )}\n {curationLabels.map((l) => (\n <span class=\"rounded-full bg-secondary px-2 py-0.5 text-2xs font-medium text-secondary-foreground\">\n {l}\n </span>\n ))}\n {submittedBy && (\n <a\n href={`/contributors/#${submittedBy.toLowerCase()}`}\n class=\"inline-flex items-center gap-1.5 rounded-full border border-border py-0.5 pl-0.5 pr-2 text-2xs font-medium text-ink-700 no-underline hover:border-ink-400 dark:text-ink-300\"\n title={`Submitted by @${submittedBy}`}\n data-submitted-by={submittedBy}\n >\n <img src={`https://github.com/${submittedBy}.png?size=32`} alt=\"\" width=\"16\" height=\"16\" loading=\"lazy\" decoding=\"async\" class=\"h-4 w-4 rounded-full\" />\n Submitted by @{submittedBy}\n </a>\n )}\n {/* Curated = reviewed provenance, not a success status. */}\n {record.curation?.reviewed && (\n <span class=\"inline-flex items-center gap-1 rounded-full border border-border bg-secondary px-2 py-0.5 text-2xs font-medium text-secondary-foreground\">\n <svg viewBox=\"0 0 16 16\" width=\"10\" height=\"10\" aria-hidden=\"true\" fill=\"currentColor\">\n <path d=\"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0Zm3.41 5.09a.75.75 0 0 0-1.06 0L6.75 8.69 5.65 7.59a.75.75 0 1 0-1.06 1.06l1.65 1.65a.75.75 0 0 0 1.06 0l4.11-4.11a.75.75 0 0 0 0-1.06Z\" />\n </svg>\n Curated\n </span>\n )}\n {activityBadge && (\n <span\n data-activity-tone={activityBadge.tone}\n class=\"grove-pill grove-pill--activity inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-2xs font-medium\"\n >\n <span class=\"relative flex h-1.5 w-1.5\">\n <span class=\"absolute inline-flex h-full w-full animate-ping rounded-full bg-current opacity-60\"></span>\n <span class=\"relative inline-flex h-1.5 w-1.5 rounded-full bg-current\"></span>\n </span>\n {activityBadge.label}\n </span>\n )}\n </div>\n </div>\n\n {/* Same pills below the identity row on narrow viewports. */}\n <div class=\"mt-3 flex flex-wrap items-center gap-1.5 md:hidden\">\n {category && (\n <span class=\"rounded-full border border-ink-200 px-2 py-0.5 text-2xs font-medium text-ink-700 dark:border-ink-800 dark:text-ink-300\">\n {category}\n </span>\n )}\n {curationLabels.map((l) => (\n <span class=\"rounded-full bg-secondary px-2 py-0.5 text-2xs font-medium text-secondary-foreground\">\n {l}\n </span>\n ))}\n {submittedBy && (\n <a\n href={`/contributors/#${submittedBy.toLowerCase()}`}\n class=\"inline-flex items-center gap-1.5 rounded-full border border-border py-0.5 pl-0.5 pr-2 text-2xs font-medium text-ink-700 no-underline hover:border-ink-400 dark:text-ink-300\"\n title={`Submitted by @${submittedBy}`}\n data-submitted-by={submittedBy}\n >\n <img src={`https://github.com/${submittedBy}.png?size=32`} alt=\"\" width=\"16\" height=\"16\" loading=\"lazy\" decoding=\"async\" class=\"h-4 w-4 rounded-full\" />\n Submitted by @{submittedBy}\n </a>\n )}\n {record.curation?.reviewed && (\n <span class=\"inline-flex items-center gap-1 rounded-full border border-border bg-secondary px-2 py-0.5 text-2xs font-medium text-secondary-foreground\">\n <svg viewBox=\"0 0 16 16\" width=\"10\" height=\"10\" aria-hidden=\"true\" fill=\"currentColor\">\n <path d=\"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0Zm3.41 5.09a.75.75 0 0 0-1.06 0L6.75 8.69 5.65 7.59a.75.75 0 1 0-1.06 1.06l1.65 1.65a.75.75 0 0 0 1.06 0l4.11-4.11a.75.75 0 0 0 0-1.06Z\" />\n </svg>\n Curated\n </span>\n )}\n </div>\n\n {/* Description — full width below the identity row. */}\n {summary && (\n <p class=\"m-0 mt-4 max-w-[72ch] text-base leading-relaxed text-ink-700 dark:text-ink-200\">\n {summary}\n </p>\n )}\n {sourceDescription && sourceDescription !== summary && (\n <p class=\"m-0 mt-2 max-w-[72ch] text-sm leading-relaxed text-ink-500 dark:text-ink-400\">\n <span class=\"text-2xs font-semibold uppercase tracking-wider\">From the project's README: </span>\n {sourceDescription}\n </p>\n )}\n\n {/* CTA row — primary actions only. */}\n <div class=\"mt-4 flex flex-wrap items-center gap-2\">\n {repoUrl && (\n <a\n href={repoUrl}\n target=\"_blank\"\n rel=\"noopener\"\n class={buttonClass(\"primary\", \"sm\")}\n data-event=\"external_repo_click\"\n data-event-source=\"record_header\"\n data-event-item={record.slug}\n >\n View on GitHub →\n </a>\n )}\n {homepageUrl && (\n <a\n href={homepageHref}\n target=\"_blank\"\n rel=\"noopener\"\n class={buttonClass(\"secondary\", \"sm\")}\n data-event=\"homepage_click\"\n data-event-source=\"record_header\"\n data-event-item={record.slug}\n >\n Homepage\n </a>\n )}\n </div>\n {screenshots && screenshots.length > 0 && (\n <div class=\"mt-6 grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3\" aria-label=\"Screenshots\">\n {screenshots.map((shot) => (\n <figure class=\"m-0 overflow-hidden rounded-[var(--radius-lg)] border border-ink-200 bg-muted dark:border-ink-800\">\n <img\n src={shot.src}\n alt={shot.alt}\n loading=\"lazy\"\n decoding=\"async\"\n width={shot.width}\n height={shot.height}\n class=\"block h-auto w-full object-cover\"\n />\n {shot.source && (\n <figcaption class=\"px-3 py-1.5 text-2xs text-ink-500 dark:text-ink-400\">\n Source: <a href={shot.source} target=\"_blank\" rel=\"noopener\" class=\"text-inherit no-underline hover:underline\">{shot.source.replace(/^https?:\\/\\//, \"\")}</a>\n </figcaption>\n )}\n </figure>\n ))}\n </div>\n )}\n</header>",
20
+ "content": "---\n/**\n * RecordHeader.astro\n *\n * Compact project-identity header used at the top of every record\n * detail page. The header carries:\n * - avatar / initials\n * - pills row (category + curation labels + \"Curated\" check +\n * optional activity badge)\n * - record name + owner/repo line\n * - short description\n * - GitHub + Homepage CTAs\n *\n * Tags + activity metadata are surfaced separately (sidebar), so\n * the header stays narrow on mobile and doesn't compete with the\n * two-column layout below.\n *\n * Tone classes for the activity badge are static `[data-activity-tone]`\n * selectors in `styles.css` — Tailwind purges any classes built from\n * dynamic strings, so the package ships the rules statically and\n * the badge's `data-activity-tone` attribute picks one at runtime.\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport type { RecordDetailModel } from '@grove-dev/astro/server';\nimport { withRef } from '@grove-dev/core';\nimport { buttonClass } from '../../lib/classnames.ts';\n\ninterface Props {\n detail: RecordDetailModel;\n}\n\nconst { detail } = Astro.props;\nconst {\n record,\n repoUrl,\n homepageUrl,\n ownerRepo,\n avatarSrc,\n initials,\n curationLabels,\n activityBadge,\n summary,\n sourceDescription,\n screenshots,\n category,\n name,\n} = detail;\n// Links to the record's own site carry `ref=<site host>`; see `outbound`\n// in grove.config.ts.\nconst outbound =\n (siteConfig as { outbound?: { ref?: string | false; skipHosts?: string[] } }).outbound ?? {};\nconst homepageHref = withRef(homepageUrl, outbound);\nconst submittedBy = (record as { submittedBy?: string }).submittedBy;\n---\n\n<header class=\"mb-8\">\n {/* Identity row: logo sized to the name+repo block beside it — no\n tall avatar column leaving dead space under the logo. Pills sit\n at the row's right edge on wide viewports and wrap below on\n mobile. */}\n <div class=\"flex items-center gap-4\">\n {/* Initials stay in the DOM behind the logo and are revealed by the\n image's own `onerror` — a dead logo URL or a renamed GitHub org\n would otherwise render the broken-image glyph. */}\n {avatarSrc && (\n <img\n src={avatarSrc}\n alt=\"\"\n width=\"56\"\n height=\"56\"\n loading=\"lazy\"\n decoding=\"async\"\n onerror=\"this.hidden=true;this.nextElementSibling.hidden=false\"\n class=\"h-12 w-12 shrink-0 rounded-lg border border-ink-200 object-contain bg-white p-1 dark:border-ink-800 sm:h-14 sm:w-14\"\n />\n )}\n <span\n aria-hidden=\"true\"\n hidden={Boolean(avatarSrc)}\n data-grove-card-fallback-initials\n class=\"inline-flex h-12 w-12 shrink-0 items-center justify-center rounded-lg border border-ink-200 bg-ink-50 text-xl font-semibold text-ink-700 dark:border-ink-800 dark:bg-ink-900 dark:text-ink-200 sm:h-14 sm:w-14\"\n >\n {initials || \"·\"}\n </span>\n\n <div class=\"min-w-0 flex-1\">\n <h1 class=\"m-0 text-[1.75rem] font-semibold leading-tight tracking-tight text-ink-900 dark:text-ink-100 sm:text-[2rem]\">\n {name}\n </h1>\n {ownerRepo && (\n <p class=\"m-0 mt-0.5 text-sm text-ink-500 dark:text-ink-400\">\n <a\n href={`https://github.com/${ownerRepo.owner}`}\n target=\"_blank\"\n rel=\"noopener\"\n class=\"text-inherit no-underline hover:text-ink-900 dark:hover:text-ink-100\"\n >\n @{ownerRepo.owner}\n </a>\n <span class=\"mx-1 text-ink-300 dark:text-ink-700\">/</span>\n <a\n href={repoUrl}\n target=\"_blank\"\n rel=\"noopener\"\n class=\"text-inherit no-underline hover:text-ink-900 dark:hover:text-ink-100\"\n >\n {ownerRepo.repo}\n </a>\n </p>\n )}\n </div>\n\n {/* Pills — right-aligned beside the name on wide viewports. */}\n <div class=\"hidden shrink-0 flex-wrap items-center justify-end gap-1.5 md:flex\">\n {category && (\n <span class=\"rounded-full border border-ink-200 px-2 py-0.5 text-2xs font-medium text-ink-700 dark:border-ink-800 dark:text-ink-300\">\n {category}\n </span>\n )}\n {curationLabels.map((l) => (\n <span class=\"rounded-full bg-secondary px-2 py-0.5 text-2xs font-medium text-secondary-foreground\">\n {l}\n </span>\n ))}\n {submittedBy && (\n <a\n href={`/contributors/#${submittedBy.toLowerCase()}`}\n class=\"inline-flex items-center gap-1.5 rounded-full border border-border py-0.5 pl-0.5 pr-2 text-2xs font-medium text-ink-700 no-underline hover:border-ink-400 dark:text-ink-300\"\n title={`Submitted by @${submittedBy}`}\n data-submitted-by={submittedBy}\n >\n <img src={`https://github.com/${submittedBy}.png?size=32`} alt=\"\" width=\"16\" height=\"16\" loading=\"lazy\" decoding=\"async\" class=\"h-4 w-4 rounded-full\" />\n Submitted by @{submittedBy}\n </a>\n )}\n {/* Curated = reviewed provenance, not a success status. */}\n {record.curation?.reviewed && (\n <span class=\"inline-flex items-center gap-1 rounded-full border border-border bg-secondary px-2 py-0.5 text-2xs font-medium text-secondary-foreground\">\n <svg viewBox=\"0 0 16 16\" width=\"10\" height=\"10\" aria-hidden=\"true\" fill=\"currentColor\">\n <path d=\"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0Zm3.41 5.09a.75.75 0 0 0-1.06 0L6.75 8.69 5.65 7.59a.75.75 0 1 0-1.06 1.06l1.65 1.65a.75.75 0 0 0 1.06 0l4.11-4.11a.75.75 0 0 0 0-1.06Z\" />\n </svg>\n Curated\n </span>\n )}\n {activityBadge && (\n <span\n data-activity-tone={activityBadge.tone}\n class=\"grove-pill grove-pill--activity inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-2xs font-medium\"\n >\n <span class=\"relative flex h-1.5 w-1.5\">\n <span class=\"absolute inline-flex h-full w-full animate-ping rounded-full bg-current opacity-60\"></span>\n <span class=\"relative inline-flex h-1.5 w-1.5 rounded-full bg-current\"></span>\n </span>\n {activityBadge.label}\n </span>\n )}\n </div>\n </div>\n\n {/* Same pills below the identity row on narrow viewports. */}\n <div class=\"mt-3 flex flex-wrap items-center gap-1.5 md:hidden\">\n {category && (\n <span class=\"rounded-full border border-ink-200 px-2 py-0.5 text-2xs font-medium text-ink-700 dark:border-ink-800 dark:text-ink-300\">\n {category}\n </span>\n )}\n {curationLabels.map((l) => (\n <span class=\"rounded-full bg-secondary px-2 py-0.5 text-2xs font-medium text-secondary-foreground\">\n {l}\n </span>\n ))}\n {submittedBy && (\n <a\n href={`/contributors/#${submittedBy.toLowerCase()}`}\n class=\"inline-flex items-center gap-1.5 rounded-full border border-border py-0.5 pl-0.5 pr-2 text-2xs font-medium text-ink-700 no-underline hover:border-ink-400 dark:text-ink-300\"\n title={`Submitted by @${submittedBy}`}\n data-submitted-by={submittedBy}\n >\n <img src={`https://github.com/${submittedBy}.png?size=32`} alt=\"\" width=\"16\" height=\"16\" loading=\"lazy\" decoding=\"async\" class=\"h-4 w-4 rounded-full\" />\n Submitted by @{submittedBy}\n </a>\n )}\n {record.curation?.reviewed && (\n <span class=\"inline-flex items-center gap-1 rounded-full border border-border bg-secondary px-2 py-0.5 text-2xs font-medium text-secondary-foreground\">\n <svg viewBox=\"0 0 16 16\" width=\"10\" height=\"10\" aria-hidden=\"true\" fill=\"currentColor\">\n <path d=\"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0Zm3.41 5.09a.75.75 0 0 0-1.06 0L6.75 8.69 5.65 7.59a.75.75 0 1 0-1.06 1.06l1.65 1.65a.75.75 0 0 0 1.06 0l4.11-4.11a.75.75 0 0 0 0-1.06Z\" />\n </svg>\n Curated\n </span>\n )}\n </div>\n\n {/* Description — full width below the identity row. */}\n {summary && (\n <p class=\"m-0 mt-4 max-w-[72ch] text-base leading-relaxed text-ink-700 dark:text-ink-200\">\n {summary}\n </p>\n )}\n {sourceDescription && sourceDescription !== summary && (\n <p class=\"m-0 mt-2 max-w-[72ch] text-sm leading-relaxed text-ink-500 dark:text-ink-400\">\n <span class=\"text-2xs font-semibold uppercase tracking-wider\">From the project's README: </span>\n {sourceDescription}\n </p>\n )}\n\n {/* CTA row — primary actions only. */}\n <div class=\"mt-4 flex flex-wrap items-center gap-2\">\n {repoUrl && (\n <a\n href={repoUrl}\n target=\"_blank\"\n rel=\"noopener\"\n class={buttonClass(\"primary\", \"sm\")}\n data-event=\"external_repo_click\"\n data-event-source=\"record_header\"\n data-event-item={record.slug}\n >\n View on GitHub →\n </a>\n )}\n {homepageUrl && (\n <a\n href={homepageHref}\n target=\"_blank\"\n rel=\"noopener\"\n class={buttonClass(\"secondary\", \"sm\")}\n data-event=\"homepage_click\"\n data-event-source=\"record_header\"\n data-event-item={record.slug}\n >\n Homepage\n </a>\n )}\n </div>\n {screenshots && screenshots.length > 0 && (\n <div class=\"mt-6 grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3\" aria-label=\"Screenshots\">\n {screenshots.map((shot) => (\n <figure class=\"m-0 overflow-hidden rounded-[var(--radius-lg)] border border-ink-200 bg-muted dark:border-ink-800\">\n <img\n src={shot.src}\n alt={shot.alt}\n loading=\"lazy\"\n decoding=\"async\"\n width={shot.width}\n height={shot.height}\n class=\"block h-auto w-full object-cover\"\n />\n {shot.source && (\n <figcaption class=\"px-3 py-1.5 text-2xs text-ink-500 dark:text-ink-400\">\n Source: <a href={shot.source} target=\"_blank\" rel=\"noopener\" class=\"text-inherit no-underline hover:underline\">{shot.source.replace(/^https?:\\/\\//, \"\")}</a>\n </figcaption>\n )}\n </figure>\n ))}\n </div>\n )}\n</header>",
21
21
  "type": "registry:component",
22
22
  "target": "~/src/components/grove/record-header.astro"
23
23
  },
24
24
  {
25
25
  "path": "default/components/grove/record-sidebar.astro",
26
- "content": "---\nimport siteConfig from '@grove/generated/site-config.json';\nimport { withRef } from '@grove-dev/core';\nimport FeaturedBadge from '../site/featured-badge.astro';\nimport type { RecordDetailModel } from '@grove-dev/astro/server';\nimport { taxonomyLabel } from '@grove-dev/astro/server';\n/**\n * RecordSidebar.astro\n *\n * Sticky right-hand column on the record detail page. Renders\n * up to four cards, each conditional on the model's `sidebar`\n * visibility flags:\n *\n * - Activity — repo facts (stars, forks, language, license, …)\n * - Freshness — last commit / last fetch / maintenance status\n * - Ecosystem — stack, platforms, category, tags, hygiene files\n * - Source — curation metadata + reading-time summary\n *\n * Empty rows are suppressed entirely — the sidebar never shows \"—\"\n * or \"0\" placeholders that confuse \"no data\" with \"zero\".\n *\n * Sticky on lg+ (`lg:sticky lg:top-20 lg:max-h-calc(100vh-5rem)\n * lg:overflow-y-auto`) so the cards stay in view while the user\n * scrolls the body. Cards are individually rendered so the\n * sticky container's height is bounded by the actual content.\n */\nimport { licenseDisplay } from '@grove-dev/core';\nimport Badge from '../ui/badge.astro';\nimport Icon from './icon.astro';\nimport LanguageBreakdown from './language-breakdown.astro';\n\ninterface Props {\n detail: RecordDetailModel;\n /**\n * Pass false when a parent wrapper owns the sticky behavior (e.g.\n * the detail page stacks the TOC above this sidebar inside one\n * sticky column).\n */\n sticky?: boolean;\n /**\n * \"column\" (default) stacks the cards vertically for a rail;\n * \"grid\" lays them out in responsive columns for full-width\n * placement below the article.\n */\n layout?: 'column' | 'grid';\n}\n\nconst { detail, sticky = true, layout = 'column' } = Astro.props;\nconst {\n sidebar,\n github,\n stars,\n forks,\n language,\n licenseSpdx,\n pushedLabel,\n repoUrl,\n ownerRepo,\n healthLabel,\n activityBadge,\n stacks,\n platforms,\n tags,\n category,\n contributionSignals,\n languages,\n totalLanguageBytes,\n readingMetrics,\n record,\n firstCommitYear,\n lastFetchedLabel,\n reviewedAtLabel,\n addedAtLabel,\n} = detail;\nconst alsoIn: Array<{ url: string; title: string }> = detail.collectionMembership ?? [];\n\n// Visibility helpers for individual rows inside the Activity card.\n// `hasRepo` is the discriminator between \"GitHub data synced\" and\n// \"no data fetched yet\" — without it the card would show \"Stars 0\"\n// even when the field was never populated.\nconst repo = github;\nconst hasRepo = !!repo;\nconst starsNumber = typeof stars === 'number' && stars > 0 ? stars : null;\nconst forksNumber = typeof forks === 'number' && forks > 0 ? forks : null;\n// `repo` is a loosely-typed passthrough of the raw GitHub API response\n// (see `@grove-dev/astro/server`'s `getRecordDetailModel`) — `releases`\n// isn't in the normalized `githubMetadataSchema`, so it arrives as\n// `unknown` and needs a local shape for the three fields read below.\nconst recentReleases = (\n (repo?.releases as Array<{ html_url?: string; tag_name?: string; name?: string }> | undefined) ??\n []\n).slice(0, 1);\nconst isArchived = !!repo?.archived;\n\n// Render a kv row only when both the label and value have content.\nfunction row(label: string, value: unknown) {\n if (value === null || value === undefined || value === '') return null;\n return { label, value };\n}\nconst outbound = (siteConfig as { outbound?: { ref?: string | false; skipHosts?: string[] } }).outbound ?? {};\nconst siteOrigin = new URL((siteConfig as { siteUrl?: string }).siteUrl ?? 'https://example.com').origin;\n---\n\n<aside\n class:list={[\n layout === \"grid\"\n ? \"grove-sidebar grid grid-cols-1 items-start gap-4 sm:grid-cols-2 xl:grid-cols-4\"\n : \"grove-sidebar flex flex-col gap-4\",\n layout === \"column\" &&\n sticky &&\n \"lg:sticky lg:top-20 lg:max-h-[calc(100vh-5rem)] lg:self-start lg:overflow-y-auto\",\n ]}\n aria-label=\"Record metadata\"\n>\n\n {/* ── Activity card ──────────────────────────────────────── */}\n {sidebar.showActivity && (\n <section\n class=\"grove-card rounded-[var(--radius-lg)] border border-ink-200 bg-card p-4 dark:border-ink-800\"\n aria-labelledby=\"sidebar-activity-title\"\n >\n <h2\n id=\"sidebar-activity-title\"\n class=\"grove-card-title m-0 mb-3 text-2xs font-semibold uppercase tracking-wider text-ink-500 dark:text-ink-400\"\n >\n Activity\n </h2>\n <dl class=\"grove-kv m-0 flex flex-col gap-2.5 text-sm\">\n {row(\"Stars\", starsNumber !== null ? starsNumber : null) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Stars</dt>\n <dd class=\"font-mono tabular-nums text-ink-900 dark:text-ink-100\">{starsNumber!.toLocaleString()}</dd>\n </div>\n )}\n {row(\"Forks\", forksNumber !== null ? forksNumber.toLocaleString() : null) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Forks</dt>\n <dd class=\"font-mono tabular-nums text-ink-900 dark:text-ink-100\">{forksNumber!.toLocaleString()}</dd>\n </div>\n )}\n {row(\"Contributors\", repo?.contributors_count) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Contributors</dt>\n <dd class=\"font-mono tabular-nums text-ink-900 dark:text-ink-100\">{Number(repo!.contributors_count).toLocaleString()}</dd>\n </div>\n )}\n {row(\"Open issues\", repo?.open_issues_count) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Open issues</dt>\n <dd class=\"font-mono tabular-nums text-ink-900 dark:text-ink-100\">{Number(repo!.open_issues_count).toLocaleString()}</dd>\n </div>\n )}\n {row(\"Watchers\", repo?.subscribers_count) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Watchers</dt>\n <dd class=\"font-mono tabular-nums text-ink-900 dark:text-ink-100\">{Number(repo!.subscribers_count).toLocaleString()}</dd>\n </div>\n )}\n {row(\"Language\", language) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Language</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">{language}</dd>\n </div>\n )}\n {row(\"License\", licenseSpdx) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">License</dt>\n <dd class=\"font-mono text-ink-900 dark:text-ink-100\">{licenseDisplay(licenseSpdx)}</dd>\n </div>\n )}\n {row(\"Default branch\", repo?.default_branch) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Default branch</dt>\n <dd class=\"font-mono text-ink-900 dark:text-ink-100\">{repo!.default_branch}</dd>\n </div>\n )}\n {row(\"First commit\", firstCommitYear) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">First commit</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">\n <time datetime={String(repo!.created_at)}>{firstCommitYear}</time>\n </dd>\n </div>\n )}\n {recentReleases[0] && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Latest release</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">\n <a\n href={recentReleases[0].html_url ?? repoUrl}\n target=\"_blank\"\n rel=\"noopener\"\n class=\"no-underline hover:underline\"\n >\n {recentReleases[0].tag_name ?? recentReleases[0].name ?? \"—\"}\n </a>\n </dd>\n </div>\n )}\n </dl>\n\n <LanguageBreakdown languages={languages} totalBytes={totalLanguageBytes} />\n </section>\n )}\n\n {/* ── Freshness card ─────────────────────────────────────── */}\n {sidebar.showFreshness && (\n <section\n class=\"grove-card rounded-[var(--radius-lg)] border border-ink-200 bg-card p-4 dark:border-ink-800\"\n aria-labelledby=\"sidebar-freshness-title\"\n >\n <h2\n id=\"sidebar-freshness-title\"\n class=\"grove-card-title m-0 mb-3 text-2xs font-semibold uppercase tracking-wider text-ink-500 dark:text-ink-400\"\n >\n Freshness\n </h2>\n <dl class=\"grove-kv m-0 flex flex-col gap-2.5 text-sm\">\n {pushedLabel && pushedLabel !== \"—\" && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Last commit</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">{pushedLabel}</dd>\n </div>\n )}\n {repo?.updated_at && lastFetchedLabel && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Last fetched</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">\n <time datetime={String(repo.updated_at)}>{lastFetchedLabel}</time>\n </dd>\n </div>\n )}\n {activityBadge && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Maintenance</dt>\n <dd>\n <span data-activity-tone={activityBadge.tone} class=\"grove-pill grove-pill--activity inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-[10px] font-medium\">\n {activityBadge.label}\n </span>\n </dd>\n </div>\n )}\n {healthLabel && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Health</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">{healthLabel}</dd>\n </div>\n )}\n {isArchived && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Status</dt>\n <dd><Badge variant=\"warning\">Archived</Badge></dd>\n </div>\n )}\n {repo?.homepage && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Docs</dt>\n <dd class=\"truncate text-ink-900 dark:text-ink-100\">\n <a href={withRef(String(repo.homepage), outbound)} target=\"_blank\" rel=\"noopener\" class=\"no-underline hover:underline\">\n {new URL(String(repo.homepage)).hostname}\n </a>\n </dd>\n </div>\n )}\n {repoUrl && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Source</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">\n <a href={repoUrl} target=\"_blank\" rel=\"noopener\" class=\"no-underline hover:underline\">\n {ownerRepo ? `${ownerRepo.owner}/${ownerRepo.repo}` : repoUrl}\n </a>\n </dd>\n </div>\n )}\n </dl>\n </section>\n )}\n\n {/* ── Ecosystem card ─────────────────────────────────────── */}\n {sidebar.showEcosystem && (\n <section\n class=\"grove-card rounded-[var(--radius-lg)] border border-ink-200 bg-card p-4 dark:border-ink-800\"\n aria-labelledby=\"sidebar-ecosystem-title\"\n >\n <h2\n id=\"sidebar-ecosystem-title\"\n class=\"grove-card-title m-0 mb-3 text-2xs font-semibold uppercase tracking-wider text-ink-500 dark:text-ink-400\"\n >\n Ecosystem\n </h2>\n\n {stacks.length > 0 && (\n <div class=\"mb-3\">\n <h3 class=\"m-0 mb-1.5 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">Stack</h3>\n <ul class=\"m-0 flex list-none flex-wrap gap-1.5 p-0\">\n {stacks.map((s) => (\n <li>\n <a href={`/stacks/${s}/`} class=\"inline-flex items-center gap-1.5 rounded-full bg-secondary py-0.5 pl-1.5 pr-2 text-2xs font-medium text-secondary-foreground no-underline\">\n <Icon name={s} category=\"stack\" size={12} />\n {taxonomyLabel(\"stacks\", s)}\n </a>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {platforms.length > 0 && (\n <div class=\"mb-3\">\n <h3 class=\"m-0 mb-1.5 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">Platforms</h3>\n <ul class=\"m-0 flex list-none flex-wrap gap-1.5 p-0\">\n {platforms.map((p) => (\n <li class=\"inline-flex items-center gap-1.5 rounded-full border border-ink-200 py-0.5 pl-1.5 pr-2 text-2xs font-medium text-ink-700 dark:border-ink-800 dark:text-ink-300\">\n <Icon name={p} category=\"platform\" size={12} />\n {taxonomyLabel(\"platforms\", p)}\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {category && (\n <div class=\"mb-3\">\n <h3 class=\"m-0 mb-1.5 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">Category</h3>\n <a href={`/categories/${category}/`} class=\"rounded-full bg-secondary px-2 py-0.5 text-2xs font-medium text-secondary-foreground no-underline\">\n {taxonomyLabel(\"categories\", category)}\n </a>\n </div>\n )}\n\n {tags.length > 0 && (\n <div class=\"mb-3\">\n <h3 class=\"m-0 mb-1.5 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">Tags</h3>\n <ul class=\"m-0 flex list-none flex-wrap gap-1.5 p-0\">\n {tags.map((t) => (\n <li>\n <a href={`/${detail.slug}?tag=${encodeURIComponent(t)}`} rel=\"nofollow\" class=\"rounded-full border border-ink-200 px-2 py-0.5 text-2xs font-medium text-ink-700 no-underline dark:border-ink-800 dark:text-ink-300\">\n {taxonomyLabel(\"topics\", t)}\n </a>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {contributionSignals.length > 0 && (\n <div>\n <h3 class=\"m-0 mb-1.5 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">Repository hygiene</h3>\n <ul class=\"m-0 flex list-none flex-col gap-1 p-0 text-sm\">\n {contributionSignals.map((s) => (\n <li class=\"inline-flex items-center gap-1.5 text-ink-700 dark:text-ink-200\">\n {s.ok ? (\n <svg viewBox=\"0 0 16 16\" width=\"11\" height=\"11\" aria-hidden=\"true\" fill=\"currentColor\" class=\"text-emerald-600 dark:text-emerald-400\">\n <path d=\"M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 0 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z\" />\n </svg>\n ) : (\n <svg viewBox=\"0 0 16 16\" width=\"11\" height=\"11\" aria-hidden=\"true\" fill=\"currentColor\" class=\"text-ink-400\">\n <path d=\"M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.75.75 0 1 1 1.06 1.06L9.06 8l3.22 3.22a.75.75 0 1 1-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 0 1-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z\" />\n </svg>\n )}\n {s.label}\n </li>\n ))}\n </ul>\n </div>\n )}\n </section>\n )}\n\n <FeaturedBadge\n pageUrl={`${siteOrigin}/${detail.slug}/${record.slug}/`}\n origin={siteOrigin}\n siteName={String((siteConfig as { name?: string }).name ?? '')}\n name={String((record as { name?: string }).name ?? record.slug)}\n outboundRef={outbound.ref}\n />\n\n {/* ── Source card (small) ────────────────────────────────── */}\n {sidebar.showSource && (\n <section\n class=\"grove-card grove-card--muted rounded-[var(--radius-lg)] border border-dashed border-ink-200 bg-card/50 p-4 text-2xs text-ink-500 dark:border-ink-800 dark:text-ink-400\"\n aria-labelledby=\"sidebar-source-title\"\n >\n <h2\n id=\"sidebar-source-title\"\n class=\"grove-card-title m-0 mb-1.5 text-2xs font-semibold uppercase tracking-wider text-ink-500 dark:text-ink-400\"\n >\n Source\n </h2>\n {addedAtLabel && (\n <p class=\"m-0 leading-relaxed\">\n Added on <time datetime={String(record.addedAt)}>{addedAtLabel}</time>.\n </p>\n )}\n {/* Only when a curator actually reviewed the record. This line\n used to render unconditionally with an em dash where the date\n belongs, and gated the whole card besides. */}\n {reviewedAtLabel && (\n <p class:list={[\"m-0 leading-relaxed\", addedAtLabel && \"mt-1.5\"]}>\n Reviewed by {record.curation?.reviewedBy ?? \"grove\"}\n on <time datetime={String(record.curation?.reviewedAt)}>\n {reviewedAtLabel}\n </time>.\n </p>\n )}\n {alsoIn.length > 0 && (\n <p class=\"m-0 mt-1.5 leading-relaxed\">\n <span class=\"font-semibold\">Also in: </span>\n {alsoIn.map((c, i) => (\n <>\n <a href={c.url} class=\"text-inherit no-underline hover:underline\">{c.title}</a>{i < alsoIn.length - 1 ? \", \" : \"\"}\n </>\n ))}\n </p>\n )}\n {readingMetrics.wordCount > 0 && (\n <p class=\"m-0 mt-1 leading-relaxed\">\n Notes: {readingMetrics.wordCount.toLocaleString()} words · {readingMetrics.minutes} min read.\n </p>\n )}\n </section>\n )}\n</aside>",
26
+ "content": "---\nimport siteConfig from '@grove/generated/site-config.json';\nimport type { RecordDetailModel } from '@grove-dev/astro/server';\nimport { taxonomyLabel } from '@grove-dev/astro/server';\n/**\n * RecordSidebar.astro\n *\n * Sticky right-hand column on the record detail page. Renders\n * up to four cards, each conditional on the model's `sidebar`\n * visibility flags:\n *\n * - Activity — repo facts (stars, forks, language, license, …)\n * - Freshness — last commit / last fetch / maintenance status\n * - Ecosystem — stack, platforms, category, tags, hygiene files\n * - Source — curation metadata + reading-time summary\n *\n * Empty rows are suppressed entirely — the sidebar never shows \"—\"\n * or \"0\" placeholders that confuse \"no data\" with \"zero\".\n *\n * Sticky on lg+ (`lg:sticky lg:top-20 lg:max-h-calc(100vh-5rem)\n * lg:overflow-y-auto`) so the cards stay in view while the user\n * scrolls the body. Cards are individually rendered so the\n * sticky container's height is bounded by the actual content.\n */\nimport { licenseDisplay, withRef } from '@grove-dev/core';\nimport FeaturedBadge from '../site/featured-badge.astro';\nimport Badge from '../ui/badge.astro';\nimport Icon from './icon.astro';\nimport LanguageBreakdown from './language-breakdown.astro';\n\ninterface Props {\n detail: RecordDetailModel;\n /**\n * Pass false when a parent wrapper owns the sticky behavior (e.g.\n * the detail page stacks the TOC above this sidebar inside one\n * sticky column).\n */\n sticky?: boolean;\n /**\n * \"column\" (default) stacks the cards vertically for a rail;\n * \"grid\" lays them out in responsive columns for full-width\n * placement below the article.\n */\n layout?: 'column' | 'grid';\n}\n\nconst { detail, sticky = true, layout = 'column' } = Astro.props;\nconst {\n sidebar,\n github,\n stars,\n forks,\n language,\n licenseSpdx,\n pushedLabel,\n repoUrl,\n ownerRepo,\n healthLabel,\n activityBadge,\n stacks,\n platforms,\n tags,\n category,\n contributionSignals,\n languages,\n totalLanguageBytes,\n readingMetrics,\n record,\n firstCommitYear,\n lastFetchedLabel,\n reviewedAtLabel,\n addedAtLabel,\n} = detail;\nconst alsoIn: Array<{ url: string; title: string }> = detail.collectionMembership ?? [];\n\n// Visibility helpers for individual rows inside the Activity card.\n// `hasRepo` is the discriminator between \"GitHub data synced\" and\n// \"no data fetched yet\" — without it the card would show \"Stars 0\"\n// even when the field was never populated.\nconst repo = github;\nconst hasRepo = !!repo;\nconst starsNumber = typeof stars === 'number' && stars > 0 ? stars : null;\nconst forksNumber = typeof forks === 'number' && forks > 0 ? forks : null;\n// `repo` is a loosely-typed passthrough of the raw GitHub API response\n// (see `@grove-dev/astro/server`'s `getRecordDetailModel`) — `releases`\n// isn't in the normalized `githubMetadataSchema`, so it arrives as\n// `unknown` and needs a local shape for the three fields read below.\nconst recentReleases = (\n (repo?.releases as Array<{ html_url?: string; tag_name?: string; name?: string }> | undefined) ??\n []\n).slice(0, 1);\nconst isArchived = !!repo?.archived;\n\n// Render a kv row only when both the label and value have content.\nfunction row(label: string, value: unknown) {\n if (value === null || value === undefined || value === '') return null;\n return { label, value };\n}\nconst outbound =\n (siteConfig as { outbound?: { ref?: string | false; skipHosts?: string[] } }).outbound ?? {};\nconst siteOrigin = new URL((siteConfig as { siteUrl?: string }).siteUrl ?? 'https://example.com')\n .origin;\n---\n\n<aside\n class:list={[\n layout === \"grid\"\n ? \"grove-sidebar grid grid-cols-1 items-start gap-4 sm:grid-cols-2 xl:grid-cols-4\"\n : \"grove-sidebar flex flex-col gap-4\",\n layout === \"column\" &&\n sticky &&\n \"lg:sticky lg:top-20 lg:max-h-[calc(100vh-5rem)] lg:self-start lg:overflow-y-auto\",\n ]}\n aria-label=\"Record metadata\"\n>\n\n {/* ── Activity card ──────────────────────────────────────── */}\n {sidebar.showActivity && (\n <section\n class=\"grove-card rounded-[var(--radius-lg)] border border-ink-200 bg-card p-4 dark:border-ink-800\"\n aria-labelledby=\"sidebar-activity-title\"\n >\n <h2\n id=\"sidebar-activity-title\"\n class=\"grove-card-title m-0 mb-3 text-2xs font-semibold uppercase tracking-wider text-ink-500 dark:text-ink-400\"\n >\n Activity\n </h2>\n <dl class=\"grove-kv m-0 flex flex-col gap-2.5 text-sm\">\n {row(\"Stars\", starsNumber !== null ? starsNumber : null) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Stars</dt>\n <dd class=\"font-mono tabular-nums text-ink-900 dark:text-ink-100\">{starsNumber!.toLocaleString()}</dd>\n </div>\n )}\n {row(\"Forks\", forksNumber !== null ? forksNumber.toLocaleString() : null) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Forks</dt>\n <dd class=\"font-mono tabular-nums text-ink-900 dark:text-ink-100\">{forksNumber!.toLocaleString()}</dd>\n </div>\n )}\n {row(\"Contributors\", repo?.contributors_count) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Contributors</dt>\n <dd class=\"font-mono tabular-nums text-ink-900 dark:text-ink-100\">{Number(repo!.contributors_count).toLocaleString()}</dd>\n </div>\n )}\n {row(\"Open issues\", repo?.open_issues_count) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Open issues</dt>\n <dd class=\"font-mono tabular-nums text-ink-900 dark:text-ink-100\">{Number(repo!.open_issues_count).toLocaleString()}</dd>\n </div>\n )}\n {row(\"Watchers\", repo?.subscribers_count) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Watchers</dt>\n <dd class=\"font-mono tabular-nums text-ink-900 dark:text-ink-100\">{Number(repo!.subscribers_count).toLocaleString()}</dd>\n </div>\n )}\n {row(\"Language\", language) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Language</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">{language}</dd>\n </div>\n )}\n {row(\"License\", licenseSpdx) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">License</dt>\n <dd class=\"font-mono text-ink-900 dark:text-ink-100\">{licenseDisplay(licenseSpdx)}</dd>\n </div>\n )}\n {row(\"Default branch\", repo?.default_branch) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Default branch</dt>\n <dd class=\"font-mono text-ink-900 dark:text-ink-100\">{repo!.default_branch}</dd>\n </div>\n )}\n {row(\"First commit\", firstCommitYear) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">First commit</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">\n <time datetime={String(repo!.created_at)}>{firstCommitYear}</time>\n </dd>\n </div>\n )}\n {recentReleases[0] && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Latest release</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">\n <a\n href={recentReleases[0].html_url ?? repoUrl}\n target=\"_blank\"\n rel=\"noopener\"\n class=\"no-underline hover:underline\"\n >\n {recentReleases[0].tag_name ?? recentReleases[0].name ?? \"—\"}\n </a>\n </dd>\n </div>\n )}\n </dl>\n\n <LanguageBreakdown languages={languages} totalBytes={totalLanguageBytes} />\n </section>\n )}\n\n {/* ── Freshness card ─────────────────────────────────────── */}\n {sidebar.showFreshness && (\n <section\n class=\"grove-card rounded-[var(--radius-lg)] border border-ink-200 bg-card p-4 dark:border-ink-800\"\n aria-labelledby=\"sidebar-freshness-title\"\n >\n <h2\n id=\"sidebar-freshness-title\"\n class=\"grove-card-title m-0 mb-3 text-2xs font-semibold uppercase tracking-wider text-ink-500 dark:text-ink-400\"\n >\n Freshness\n </h2>\n <dl class=\"grove-kv m-0 flex flex-col gap-2.5 text-sm\">\n {pushedLabel && pushedLabel !== \"—\" && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Last commit</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">{pushedLabel}</dd>\n </div>\n )}\n {repo?.updated_at && lastFetchedLabel && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Last fetched</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">\n <time datetime={String(repo.updated_at)}>{lastFetchedLabel}</time>\n </dd>\n </div>\n )}\n {activityBadge && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Maintenance</dt>\n <dd>\n <span data-activity-tone={activityBadge.tone} class=\"grove-pill grove-pill--activity inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-[10px] font-medium\">\n {activityBadge.label}\n </span>\n </dd>\n </div>\n )}\n {healthLabel && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Health</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">{healthLabel}</dd>\n </div>\n )}\n {isArchived && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Status</dt>\n <dd><Badge variant=\"warning\">Archived</Badge></dd>\n </div>\n )}\n {repo?.homepage && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Docs</dt>\n <dd class=\"truncate text-ink-900 dark:text-ink-100\">\n <a href={withRef(String(repo.homepage), outbound)} target=\"_blank\" rel=\"noopener\" class=\"no-underline hover:underline\">\n {new URL(String(repo.homepage)).hostname}\n </a>\n </dd>\n </div>\n )}\n {repoUrl && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Source</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">\n <a href={repoUrl} target=\"_blank\" rel=\"noopener\" class=\"no-underline hover:underline\">\n {ownerRepo ? `${ownerRepo.owner}/${ownerRepo.repo}` : repoUrl}\n </a>\n </dd>\n </div>\n )}\n </dl>\n </section>\n )}\n\n {/* ── Ecosystem card ─────────────────────────────────────── */}\n {sidebar.showEcosystem && (\n <section\n class=\"grove-card rounded-[var(--radius-lg)] border border-ink-200 bg-card p-4 dark:border-ink-800\"\n aria-labelledby=\"sidebar-ecosystem-title\"\n >\n <h2\n id=\"sidebar-ecosystem-title\"\n class=\"grove-card-title m-0 mb-3 text-2xs font-semibold uppercase tracking-wider text-ink-500 dark:text-ink-400\"\n >\n Ecosystem\n </h2>\n\n {stacks.length > 0 && (\n <div class=\"mb-3\">\n <h3 class=\"m-0 mb-1.5 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">Stack</h3>\n <ul class=\"m-0 flex list-none flex-wrap gap-1.5 p-0\">\n {stacks.map((s) => (\n <li>\n <a href={`/stacks/${s}/`} class=\"inline-flex items-center gap-1.5 rounded-full bg-secondary py-0.5 pl-1.5 pr-2 text-2xs font-medium text-secondary-foreground no-underline\">\n <Icon name={s} category=\"stack\" size={12} />\n {taxonomyLabel(\"stacks\", s)}\n </a>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {platforms.length > 0 && (\n <div class=\"mb-3\">\n <h3 class=\"m-0 mb-1.5 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">Platforms</h3>\n <ul class=\"m-0 flex list-none flex-wrap gap-1.5 p-0\">\n {platforms.map((p) => (\n <li class=\"inline-flex items-center gap-1.5 rounded-full border border-ink-200 py-0.5 pl-1.5 pr-2 text-2xs font-medium text-ink-700 dark:border-ink-800 dark:text-ink-300\">\n <Icon name={p} category=\"platform\" size={12} />\n {taxonomyLabel(\"platforms\", p)}\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {category && (\n <div class=\"mb-3\">\n <h3 class=\"m-0 mb-1.5 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">Category</h3>\n <a href={`/categories/${category}/`} class=\"rounded-full bg-secondary px-2 py-0.5 text-2xs font-medium text-secondary-foreground no-underline\">\n {taxonomyLabel(\"categories\", category)}\n </a>\n </div>\n )}\n\n {tags.length > 0 && (\n <div class=\"mb-3\">\n <h3 class=\"m-0 mb-1.5 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">Tags</h3>\n <ul class=\"m-0 flex list-none flex-wrap gap-1.5 p-0\">\n {tags.map((t) => (\n <li>\n <a href={`/${detail.slug}?tag=${encodeURIComponent(t)}`} rel=\"nofollow\" class=\"rounded-full border border-ink-200 px-2 py-0.5 text-2xs font-medium text-ink-700 no-underline dark:border-ink-800 dark:text-ink-300\">\n {taxonomyLabel(\"topics\", t)}\n </a>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {contributionSignals.length > 0 && (\n <div>\n <h3 class=\"m-0 mb-1.5 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">Repository hygiene</h3>\n <ul class=\"m-0 flex list-none flex-col gap-1 p-0 text-sm\">\n {contributionSignals.map((s) => (\n <li class=\"inline-flex items-center gap-1.5 text-ink-700 dark:text-ink-200\">\n {s.ok ? (\n <svg viewBox=\"0 0 16 16\" width=\"11\" height=\"11\" aria-hidden=\"true\" fill=\"currentColor\" class=\"text-emerald-600 dark:text-emerald-400\">\n <path d=\"M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 0 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z\" />\n </svg>\n ) : (\n <svg viewBox=\"0 0 16 16\" width=\"11\" height=\"11\" aria-hidden=\"true\" fill=\"currentColor\" class=\"text-ink-400\">\n <path d=\"M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.75.75 0 1 1 1.06 1.06L9.06 8l3.22 3.22a.75.75 0 1 1-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 0 1-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z\" />\n </svg>\n )}\n {s.label}\n </li>\n ))}\n </ul>\n </div>\n )}\n </section>\n )}\n\n <FeaturedBadge\n pageUrl={`${siteOrigin}/${detail.slug}/${record.slug}/`}\n origin={siteOrigin}\n siteName={String((siteConfig as { name?: string }).name ?? '')}\n name={String((record as { name?: string }).name ?? record.slug)}\n outboundRef={outbound.ref}\n />\n\n {/* ── Source card (small) ────────────────────────────────── */}\n {sidebar.showSource && (\n <section\n class=\"grove-card grove-card--muted rounded-[var(--radius-lg)] border border-dashed border-ink-200 bg-card/50 p-4 text-2xs text-ink-500 dark:border-ink-800 dark:text-ink-400\"\n aria-labelledby=\"sidebar-source-title\"\n >\n <h2\n id=\"sidebar-source-title\"\n class=\"grove-card-title m-0 mb-1.5 text-2xs font-semibold uppercase tracking-wider text-ink-500 dark:text-ink-400\"\n >\n Source\n </h2>\n {addedAtLabel && (\n <p class=\"m-0 leading-relaxed\">\n Added on <time datetime={String(record.addedAt)}>{addedAtLabel}</time>.\n </p>\n )}\n {/* Only when a curator actually reviewed the record. This line\n used to render unconditionally with an em dash where the date\n belongs, and gated the whole card besides. */}\n {reviewedAtLabel && (\n <p class:list={[\"m-0 leading-relaxed\", addedAtLabel && \"mt-1.5\"]}>\n Reviewed by {record.curation?.reviewedBy ?? \"grove\"}\n on <time datetime={String(record.curation?.reviewedAt)}>\n {reviewedAtLabel}\n </time>.\n </p>\n )}\n {alsoIn.length > 0 && (\n <p class=\"m-0 mt-1.5 leading-relaxed\">\n <span class=\"font-semibold\">Also in: </span>\n {alsoIn.map((c, i) => (\n <>\n <a href={c.url} class=\"text-inherit no-underline hover:underline\">{c.title}</a>{i < alsoIn.length - 1 ? \", \" : \"\"}\n </>\n ))}\n </p>\n )}\n {readingMetrics.wordCount > 0 && (\n <p class=\"m-0 mt-1 leading-relaxed\">\n Notes: {readingMetrics.wordCount.toLocaleString()} words · {readingMetrics.minutes} min read.\n </p>\n )}\n </section>\n )}\n</aside>",
27
27
  "type": "registry:component",
28
28
  "target": "~/src/components/grove/record-sidebar.astro"
29
29
  },
@@ -71,8 +71,8 @@
71
71
  }
72
72
  ],
73
73
  "meta": {
74
- "version": "1.4.0",
75
- "requiresGrove": "0.19.0"
74
+ "version": "1.5.0",
75
+ "requiresGrove": "1.0.1"
76
76
  },
77
77
  "type": "registry:block"
78
78
  }
@@ -46,8 +46,8 @@
46
46
  }
47
47
  ],
48
48
  "meta": {
49
- "version": "1.4.0",
50
- "requiresGrove": "0.19.0"
49
+ "version": "1.5.0",
50
+ "requiresGrove": "1.0.1"
51
51
  }
52
52
  },
53
53
  {
@@ -112,8 +112,8 @@
112
112
  }
113
113
  ],
114
114
  "meta": {
115
- "version": "1.4.0",
116
- "requiresGrove": "0.19.0"
115
+ "version": "1.5.0",
116
+ "requiresGrove": "1.0.1"
117
117
  }
118
118
  },
119
119
  {
@@ -154,8 +154,8 @@
154
154
  }
155
155
  ],
156
156
  "meta": {
157
- "version": "1.4.0",
158
- "requiresGrove": "0.19.0"
157
+ "version": "1.5.0",
158
+ "requiresGrove": "1.0.1"
159
159
  }
160
160
  },
161
161
  {
@@ -212,8 +212,8 @@
212
212
  }
213
213
  ],
214
214
  "meta": {
215
- "version": "1.4.0",
216
- "requiresGrove": "0.19.0"
215
+ "version": "1.5.0",
216
+ "requiresGrove": "1.0.1"
217
217
  }
218
218
  },
219
219
  {
@@ -289,8 +289,8 @@
289
289
  }
290
290
  ],
291
291
  "meta": {
292
- "version": "1.4.0",
293
- "requiresGrove": "0.19.0"
292
+ "version": "1.5.0",
293
+ "requiresGrove": "1.0.1"
294
294
  }
295
295
  },
296
296
  {
@@ -353,8 +353,8 @@
353
353
  }
354
354
  ],
355
355
  "meta": {
356
- "version": "1.4.0",
357
- "requiresGrove": "0.19.0"
356
+ "version": "1.5.0",
357
+ "requiresGrove": "1.0.1"
358
358
  }
359
359
  },
360
360
  {
@@ -440,8 +440,8 @@
440
440
  }
441
441
  ],
442
442
  "meta": {
443
- "version": "1.4.0",
444
- "requiresGrove": "0.19.0"
443
+ "version": "1.5.0",
444
+ "requiresGrove": "1.0.1"
445
445
  }
446
446
  },
447
447
  {
@@ -507,8 +507,8 @@
507
507
  }
508
508
  ],
509
509
  "meta": {
510
- "version": "1.4.0",
511
- "requiresGrove": "0.19.0"
510
+ "version": "1.5.0",
511
+ "requiresGrove": "1.0.1"
512
512
  }
513
513
  },
514
514
  {
@@ -533,8 +533,8 @@
533
533
  }
534
534
  ],
535
535
  "meta": {
536
- "version": "1.4.0",
537
- "requiresGrove": "0.19.0"
536
+ "version": "1.5.0",
537
+ "requiresGrove": "1.0.1"
538
538
  }
539
539
  },
540
540
  {
@@ -554,8 +554,8 @@
554
554
  }
555
555
  ],
556
556
  "meta": {
557
- "version": "1.4.0",
558
- "requiresGrove": "0.19.0"
557
+ "version": "1.5.0",
558
+ "requiresGrove": "1.0.1"
559
559
  }
560
560
  },
561
561
  {
@@ -575,8 +575,8 @@
575
575
  }
576
576
  ],
577
577
  "meta": {
578
- "version": "1.4.0",
579
- "requiresGrove": "0.19.0"
578
+ "version": "1.5.0",
579
+ "requiresGrove": "1.0.1"
580
580
  }
581
581
  },
582
582
  {
@@ -596,8 +596,8 @@
596
596
  }
597
597
  ],
598
598
  "meta": {
599
- "version": "1.4.0",
600
- "requiresGrove": "0.19.0"
599
+ "version": "1.5.0",
600
+ "requiresGrove": "1.0.1"
601
601
  }
602
602
  },
603
603
  {
@@ -1019,8 +1019,8 @@
1019
1019
  }
1020
1020
  ],
1021
1021
  "meta": {
1022
- "version": "1.4.0",
1023
- "requiresGrove": "0.19.0"
1022
+ "version": "1.5.0",
1023
+ "requiresGrove": "1.0.1"
1024
1024
  }
1025
1025
  }
1026
1026
  ]
package/dist/r/shell.json CHANGED
@@ -33,7 +33,7 @@
33
33
  },
34
34
  {
35
35
  "path": "default/layouts/header.astro",
36
- "content": "---\n/**\n * Header — sticky brand + nav + theme toggle.\n *\n * Generic: takes a `site` prop with brand + nav. No `siteConfig`\n * import — consumers compose the props from their own config.\n *\n * Optional `submit` button renders a \"Submit app\" / \"Submit project\"\n * call-to-action on the right side of the nav. Set `submitHref` /\n * `submitLabel` to enable, leave them undefined for a clean header.\n *\n * Optional `repoUrl` adds a \"View source\" GitHub button. Set\n * `repoLabel` to change the visible text.\n *\n * A nav item with `children` opens a menu panel; `menu: \"collections\"`\n * fills the panel from the collection files. The item whose `href` (or\n * a child's) prefixes the current path is marked `aria-current`.\n */\n\nimport { loadCollections } from '@grove-dev/astro/server';\nimport { compact } from '@grove-dev/core';\nimport ThemeToggle from '../components/site/theme-toggle.astro';\nimport { buttonClass } from '../lib/classnames.ts';\n\ninterface NavLink {\n label: string;\n href: string;\n description?: string;\n}\n\ninterface NavItem extends NavLink {\n children?: NavLink[];\n menu?: 'collections';\n}\n\ninterface Site {\n name: string;\n tagline?: string;\n nav: NavItem[];\n description?: string;\n repoUrl?: string;\n url?: string;\n /** Logo path under `public/` (e.g. `/logo.svg`). */\n logo?: string;\n stats?: {\n /** Stars on this site's own source repository. */\n repositoryStars?: number;\n };\n blueprintConfig?: {\n routeSlug?: string;\n };\n}\n\ninterface Props {\n site: Site;\n /** Submit button label, e.g. \"Submit app\". Omit to hide. */\n submitLabel?: string;\n /** Submit button href, e.g. \"/submit\". Omit to hide. */\n submitHref?: string;\n /** GitHub button label, e.g. \"View source\". */\n repoLabel?: string;\n /** Extra class for the outer header element. */\n class?: string;\n}\n\nconst { site, submitLabel, submitHref, repoLabel = 'Star', class: className = '' } = Astro.props;\nconst directoryPath = `/${site.blueprintConfig?.routeSlug ?? 'items'}`;\nconst defaultNavItems = site.blueprintConfig\n ? [\n { label: 'Recently added', href: `${directoryPath}?sort=recently-added` },\n { label: 'Trending', href: `${directoryPath}?label=hot` },\n { label: 'Categories', href: '/categories' },\n { label: 'Stacks', href: '/stacks' },\n { label: 'About', href: '/about' },\n ]\n : [];\nconst navItems: NavItem[] = site.nav?.length ? site.nav : defaultNavItems;\n\n// Resolve menus: explicit children, or the collection files for\n// `menu: \"collections\"` (loaded only when a nav item asks for them).\nconst collections = navItems.some((item) => item.menu === 'collections')\n ? await loadCollections(process.cwd())\n : [];\nconst menus = navItems.map((item) => {\n const children: NavLink[] =\n item.menu === 'collections'\n ? collections\n .map((c) => ({ label: c.title, href: `/collections/${c.slug}/`, description: c.description }))\n .sort((a, b) => a.label.localeCompare(b.label))\n : (item.children ?? []);\n return { ...item, children, footer: item.menu === 'collections' ? { label: 'All collections', href: item.href } : undefined };\n});\nconst withSlash = (path: string) => (path.endsWith('/') ? path : `${path}/`);\nconst pathname = withSlash(Astro.url.pathname);\nconst isCurrent = (item: (typeof menus)[number]) =>\n [item.href, ...item.children.map((c) => c.href)]\n .map((href) => withSlash(href.split('?')[0] ?? ''))\n .some((href) => href !== '/' && pathname.startsWith(href));\nconst stars = site.stats?.repositoryStars;\nconst starsLabel = typeof stars === 'number' ? compact(stars) : null;\n---\n\n<header\n class:list={[\n \"border-border bg-background/85 sticky top-0 z-50 border-b backdrop-blur\",\n className,\n ]}\n>\n <div\n class=\"mx-auto flex w-full max-w-container items-center gap-3 px-5 py-3 sm:gap-6 sm:px-7\"\n >\n <a\n href=\"/\"\n class=\"inline-flex min-w-0 shrink items-center gap-2 text-[0.95rem] font-semibold tracking-tight text-ink-900 dark:text-ink-100\"\n >\n {site.logo ? (\n <img\n src={site.logo}\n alt=\"\"\n aria-hidden=\"true\"\n width=\"18\"\n height=\"18\"\n class=\"inline-block h-[18px] w-[18px] shrink-0 object-contain\"\n />\n ) : (\n /* No logo configured — a neutral mark is the honest default.\n Set `site.logo` in grove.config.ts to replace it. */\n <span\n aria-hidden=\"true\"\n class=\"inline-block h-[18px] w-[18px] rounded bg-ink-900 dark:bg-ink-100\"\n ></span>\n )}\n <span class=\"truncate\">{site.name}</span>\n </a>\n\n <nav class=\"hidden flex-1 md:block\" aria-label=\"Primary\">\n <ul class=\"m-0 flex list-none items-center gap-1 p-0\">\n {menus.map((menu) => {\n const current = isCurrent(menu);\n const itemClass = [\n \"relative inline-flex h-8 cursor-pointer list-none items-center gap-1 rounded-[var(--radius)] px-2.5 text-[0.875rem] font-medium no-underline outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/35 [&::-webkit-details-marker]:hidden\",\n current ? \"text-foreground after:absolute after:inset-x-2.5 after:-bottom-[0.8125rem] after:h-0.5 after:rounded-full after:bg-foreground after:content-['']\" : \"text-muted-foreground\",\n ].join(\" \");\n return (\n <li class=\"relative\">\n {menu.children.length > 0 ? (\n <details class=\"group\" data-nav-menu>\n <summary class={itemClass} aria-current={current ? \"page\" : undefined}>\n {menu.label}\n <svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-60 transition-transform group-open:rotate-180\"><path d=\"m4 6 4 4 4-4\"></path></svg>\n </summary>\n <div class:list={[\n \"absolute left-0 top-[calc(100%+0.625rem)] z-50 rounded-[var(--radius-lg)] border border-border bg-popover p-2 shadow-lg\",\n menu.children.length > 5 ? \"w-[34rem]\" : \"w-80\",\n ]}>\n <ul class:list={[\"m-0 grid list-none gap-0.5 p-0\", menu.children.length > 5 && \"grid-cols-2\"]}>\n {menu.children.map((item) => (\n <li>\n <a href={item.href} class=\"block rounded-[var(--radius)] px-3 py-2 no-underline outline-none hover:bg-accent focus-visible:bg-accent\">\n <span class=\"block text-sm font-medium text-foreground\">{item.label}</span>\n {item.description && <span class=\"mt-0.5 line-clamp-2 block text-2xs leading-snug text-muted-foreground\">{item.description}</span>}\n </a>\n </li>\n ))}\n </ul>\n {menu.footer && (\n <a href={menu.footer.href} class=\"mt-1 flex items-center justify-between rounded-[var(--radius)] border-t border-border px-3 pb-1 pt-2.5 text-sm font-medium text-foreground no-underline hover:underline\">\n {menu.footer.label}<span aria-hidden=\"true\">→</span>\n </a>\n )}\n </div>\n </details>\n ) : (\n <a href={menu.href} class={itemClass} aria-current={current ? \"page\" : undefined}>{menu.label}</a>\n )}\n </li>\n );\n })}\n </ul>\n </nav>\n\n <div class=\"ml-auto flex items-center gap-2\">\n <details class=\"group relative md:hidden\" data-nav-menu>\n <summary class=\"inline-flex h-9 cursor-pointer list-none items-center justify-center gap-1.5 rounded-[var(--radius)] border border-border bg-secondary px-2.5 text-sm font-medium text-foreground hover:bg-accent focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/35 [&::-webkit-details-marker]:hidden\">\n <svg viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\"><path d=\"M2.5 4.5h11M2.5 8h11M2.5 11.5h11\"></path></svg>\n Menu\n </summary>\n <nav aria-label=\"Mobile primary\" class=\"fixed inset-x-3 top-[3.75rem] z-50 max-h-[calc(100dvh-5rem)] overflow-y-auto rounded-[var(--radius-lg)] border border-border bg-popover p-3 shadow-lg\">\n <ul class=\"m-0 flex list-none flex-col gap-3 p-0\">\n {menus.map((menu) => (\n <li>\n <a href={menu.href} aria-current={isCurrent(menu) ? \"page\" : undefined} class=\"block rounded-md px-2 py-1.5 text-sm font-semibold text-foreground no-underline hover:bg-accent aria-[current=page]:bg-accent\">{menu.label}</a>\n {menu.children.length > 0 && (\n <ul class=\"m-0 mt-1 grid list-none grid-cols-2 gap-0.5 p-0\">\n {menu.children.map((item) => (\n <li><a href={item.href} class=\"block truncate rounded-md px-2 py-1.5 text-sm text-muted-foreground no-underline hover:bg-accent hover:text-foreground\">{item.label}</a></li>\n ))}\n </ul>\n )}\n </li>\n ))}\n {submitHref && (\n <li class=\"border-t border-border pt-3\">\n <a href={submitHref} class={buttonClass(\"primary\", \"md\", \"w-full justify-center\")}>{submitLabel ?? \"Submit\"}</a>\n </li>\n )}\n </ul>\n </nav>\n </details>\n\n {submitHref && (\n <a\n href={submitHref}\n class={buttonClass(\"primary\", \"sm\", \"max-sm:!hidden\")}\n >\n <svg\n viewBox=\"0 0 16 16\"\n width=\"13\"\n height=\"13\"\n aria-hidden=\"true\"\n fill=\"currentColor\"\n >\n <path d=\"M7.75 2a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 7.75 2Z\"></path>\n </svg>\n <span>{submitLabel ?? \"Submit\"}</span>\n </a>\n )}\n\n {site.repoUrl && (\n <a\n href={site.repoUrl}\n target=\"_blank\"\n rel=\"noopener\"\n aria-label={`${repoLabel} on GitHub${starsLabel ? ` — ${starsLabel} stars` : \"\"}`}\n title={`${repoLabel} on GitHub`}\n class={buttonClass(\"secondary\", \"bare\", \"h-8 overflow-hidden p-0 text-sm\")}\n >\n <span class=\"flex items-center gap-1.5 px-2.5 py-1.5 text-ink-900 dark:text-ink-100\">\n <svg viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" aria-hidden=\"true\" fill=\"currentColor\">\n <path d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38v-1.33c-2.22.48-2.69-1.07-2.69-1.07-.36-.92-.89-1.17-.89-1.17-.73-.5.05-.49.05-.49.8.06 1.23.83 1.23.83.72 1.22 1.87.87 2.33.67.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48v2.19c0 .21.15.46.55.38A8 8 0 0 0 8 0Z\"></path>\n </svg>\n <span class=\"hidden lg:inline\">{repoLabel}</span>\n </span>\n {starsLabel && <span class=\"hidden items-center gap-1 border-s border-border bg-secondary px-2 py-1.5 text-secondary-foreground sm:flex\">\n <svg viewBox=\"0 0 16 16\" width=\"11\" height=\"11\" aria-hidden=\"true\" fill=\"currentColor\" class=\"text-warning\">\n <path d=\"M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Z\"></path>\n </svg>\n <span class=\"font-mono\">{starsLabel}</span>\n </span>}\n </a>\n )}\n\n <ThemeToggle />\n </div>\n </div>\n</header>\n\n<script>\n // Nav menus are <details>: one open at a time, closed by Escape,\n // an outside click, or following a link inside the panel.\n const menus = [...document.querySelectorAll<HTMLDetailsElement>(\"[data-nav-menu]\")];\n const closeAll = (except?: HTMLDetailsElement) =>\n menus.forEach((menu) => { if (menu !== except) menu.open = false; });\n menus.forEach((menu) => {\n menu.addEventListener(\"toggle\", () => { if (menu.open) closeAll(menu); });\n menu.addEventListener(\"click\", (e) => {\n if ((e.target as HTMLElement).closest(\"a\")) menu.open = false;\n });\n });\n document.addEventListener(\"click\", (e) => {\n if (!(e.target as HTMLElement).closest(\"[data-nav-menu]\")) closeAll();\n });\n document.addEventListener(\"keydown\", (e) => {\n if (e.key !== \"Escape\") return;\n const open = menus.find((menu) => menu.open);\n if (!open) return;\n open.open = false;\n open.querySelector(\"summary\")?.focus();\n });\n\n // Smooth-scroll for in-page anchor links (Header nav + Hero CTA).\n // Works on any <a href=\"#…\"> that points to an existing element on\n // the current page. External links (e.g. /about, /projects?…) are\n // skipped because they don't start with \"#\". Modifier-clicks\n // (Cmd/Ctrl/Shift/middle) let the browser handle the anchor\n // normally so users can open the same section in a new tab.\n document.addEventListener(\"click\", (e) => {\n if (e.defaultPrevented) return;\n if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;\n if (e.button !== 0) return;\n const link = (e.target as HTMLElement).closest<HTMLAnchorElement>(\n 'a[href^=\"#\"]',\n );\n if (!link) return;\n const id = link.getAttribute(\"href\")!;\n if (id.length <= 1) return;\n const target = document.querySelector(id);\n if (!target) return;\n e.preventDefault();\n target.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n history.replaceState(null, \"\", id);\n });\n</script>\n",
36
+ "content": "---\n/**\n * Header — sticky brand + nav + theme toggle.\n *\n * Generic: takes a `site` prop with brand + nav. No `siteConfig`\n * import — consumers compose the props from their own config.\n *\n * Optional `submit` button renders a \"Submit app\" / \"Submit project\"\n * call-to-action on the right side of the nav. Set `submitHref` /\n * `submitLabel` to enable, leave them undefined for a clean header.\n *\n * Optional `repoUrl` adds a \"View source\" GitHub button. Set\n * `repoLabel` to change the visible text.\n *\n * A nav item with `children` opens a menu panel; `menu: \"collections\"`\n * fills the panel from the collection files. The item whose `href` (or\n * a child's) prefixes the current path is marked `aria-current`.\n */\n\nimport { loadCollections } from '@grove-dev/astro/server';\nimport { compact } from '@grove-dev/core';\nimport ThemeToggle from '../components/site/theme-toggle.astro';\nimport { buttonClass } from '../lib/classnames.ts';\n\ninterface NavLink {\n label: string;\n href: string;\n description?: string;\n}\n\ninterface NavItem extends NavLink {\n children?: NavLink[];\n menu?: 'collections';\n}\n\ninterface Site {\n name: string;\n tagline?: string;\n nav: NavItem[];\n description?: string;\n repoUrl?: string;\n url?: string;\n /** Logo path under `public/` (e.g. `/logo.svg`). */\n logo?: string;\n stats?: {\n /** Stars on this site's own source repository. */\n repositoryStars?: number;\n };\n blueprintConfig?: {\n routeSlug?: string;\n };\n}\n\ninterface Props {\n site: Site;\n /** Submit button label, e.g. \"Submit app\". Omit to hide. */\n submitLabel?: string;\n /** Submit button href, e.g. \"/submit\". Omit to hide. */\n submitHref?: string;\n /** GitHub button label, e.g. \"View source\". */\n repoLabel?: string;\n /** Extra class for the outer header element. */\n class?: string;\n}\n\nconst { site, submitLabel, submitHref, repoLabel = 'Star', class: className = '' } = Astro.props;\nconst directoryPath = `/${site.blueprintConfig?.routeSlug ?? 'items'}`;\nconst defaultNavItems = site.blueprintConfig\n ? [\n { label: 'Recently added', href: `${directoryPath}?sort=recently-added` },\n { label: 'Trending', href: `${directoryPath}?label=hot` },\n { label: 'Categories', href: '/categories' },\n { label: 'Stacks', href: '/stacks' },\n { label: 'About', href: '/about' },\n ]\n : [];\nconst navItems: NavItem[] = site.nav?.length ? site.nav : defaultNavItems;\n\n// Resolve menus: explicit children, or the collection files for\n// `menu: \"collections\"` (loaded only when a nav item asks for them).\nconst collections = navItems.some((item) => item.menu === 'collections')\n ? await loadCollections(process.cwd())\n : [];\nconst menus = navItems.map((item) => {\n const children: NavLink[] =\n item.menu === 'collections'\n ? collections\n .map((c) => ({\n label: c.title,\n href: `/collections/${c.slug}/`,\n description: c.description,\n }))\n .sort((a, b) => a.label.localeCompare(b.label))\n : (item.children ?? []);\n return {\n ...item,\n children,\n footer: item.menu === 'collections' ? { label: 'All collections', href: item.href } : undefined,\n };\n});\nconst withSlash = (path: string) => (path.endsWith('/') ? path : `${path}/`);\nconst pathname = withSlash(Astro.url.pathname);\nconst isCurrent = (item: (typeof menus)[number]) =>\n [item.href, ...item.children.map((c) => c.href)]\n .map((href) => withSlash(href.split('?')[0] ?? ''))\n .some((href) => href !== '/' && pathname.startsWith(href));\nconst stars = site.stats?.repositoryStars;\nconst starsLabel = typeof stars === 'number' ? compact(stars) : null;\n---\n\n<header\n class:list={[\n \"border-border bg-background/85 sticky top-0 z-50 border-b backdrop-blur\",\n className,\n ]}\n>\n <div\n class=\"mx-auto flex w-full max-w-container items-center gap-3 px-5 py-3 sm:gap-6 sm:px-7\"\n >\n <a\n href=\"/\"\n class=\"inline-flex min-w-0 shrink items-center gap-2 text-[0.95rem] font-semibold tracking-tight text-ink-900 dark:text-ink-100\"\n >\n {site.logo ? (\n <img\n src={site.logo}\n alt=\"\"\n aria-hidden=\"true\"\n width=\"18\"\n height=\"18\"\n class=\"inline-block h-[18px] w-[18px] shrink-0 object-contain\"\n />\n ) : (\n /* No logo configured — a neutral mark is the honest default.\n Set `site.logo` in grove.config.ts to replace it. */\n <span\n aria-hidden=\"true\"\n class=\"inline-block h-[18px] w-[18px] rounded bg-ink-900 dark:bg-ink-100\"\n ></span>\n )}\n <span class=\"truncate\">{site.name}</span>\n </a>\n\n <nav class=\"hidden flex-1 md:block\" aria-label=\"Primary\">\n <ul class=\"m-0 flex list-none items-center gap-1 p-0\">\n {menus.map((menu) => {\n const current = isCurrent(menu);\n const itemClass = [\n \"relative inline-flex h-8 cursor-pointer list-none items-center gap-1 rounded-[var(--radius)] px-2.5 text-[0.875rem] font-medium no-underline outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/35 [&::-webkit-details-marker]:hidden\",\n current ? \"text-foreground after:absolute after:inset-x-2.5 after:-bottom-[0.8125rem] after:h-0.5 after:rounded-full after:bg-foreground after:content-['']\" : \"text-muted-foreground\",\n ].join(\" \");\n return (\n <li class=\"relative\">\n {menu.children.length > 0 ? (\n <details class=\"group\" data-nav-menu>\n <summary class={itemClass} aria-current={current ? \"page\" : undefined}>\n {menu.label}\n <svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-60 transition-transform group-open:rotate-180\"><path d=\"m4 6 4 4 4-4\"></path></svg>\n </summary>\n <div class:list={[\n \"absolute left-0 top-[calc(100%+0.625rem)] z-50 rounded-[var(--radius-lg)] border border-border bg-popover p-2 shadow-lg\",\n menu.children.length > 5 ? \"w-[34rem]\" : \"w-80\",\n ]}>\n <ul class:list={[\"m-0 grid list-none gap-0.5 p-0\", menu.children.length > 5 && \"grid-cols-2\"]}>\n {menu.children.map((item) => (\n <li>\n <a href={item.href} class=\"block rounded-[var(--radius)] px-3 py-2 no-underline outline-none hover:bg-accent focus-visible:bg-accent\">\n <span class=\"block text-sm font-medium text-foreground\">{item.label}</span>\n {item.description && <span class=\"mt-0.5 line-clamp-2 block text-2xs leading-snug text-muted-foreground\">{item.description}</span>}\n </a>\n </li>\n ))}\n </ul>\n {menu.footer && (\n <a href={menu.footer.href} class=\"mt-1 flex items-center justify-between rounded-[var(--radius)] border-t border-border px-3 pb-1 pt-2.5 text-sm font-medium text-foreground no-underline hover:underline\">\n {menu.footer.label}<span aria-hidden=\"true\">→</span>\n </a>\n )}\n </div>\n </details>\n ) : (\n <a href={menu.href} class={itemClass} aria-current={current ? \"page\" : undefined}>{menu.label}</a>\n )}\n </li>\n );\n })}\n </ul>\n </nav>\n\n <div class=\"ml-auto flex items-center gap-2\">\n <details class=\"group relative md:hidden\" data-nav-menu>\n <summary class=\"inline-flex h-9 cursor-pointer list-none items-center justify-center gap-1.5 rounded-[var(--radius)] border border-border bg-secondary px-2.5 text-sm font-medium text-foreground hover:bg-accent focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/35 [&::-webkit-details-marker]:hidden\">\n <svg viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\"><path d=\"M2.5 4.5h11M2.5 8h11M2.5 11.5h11\"></path></svg>\n Menu\n </summary>\n <nav aria-label=\"Mobile primary\" class=\"fixed inset-x-3 top-[3.75rem] z-50 max-h-[calc(100dvh-5rem)] overflow-y-auto rounded-[var(--radius-lg)] border border-border bg-popover p-3 shadow-lg\">\n <ul class=\"m-0 flex list-none flex-col gap-3 p-0\">\n {menus.map((menu) => (\n <li>\n <a href={menu.href} aria-current={isCurrent(menu) ? \"page\" : undefined} class=\"block rounded-md px-2 py-1.5 text-sm font-semibold text-foreground no-underline hover:bg-accent aria-[current=page]:bg-accent\">{menu.label}</a>\n {menu.children.length > 0 && (\n <ul class=\"m-0 mt-1 grid list-none grid-cols-2 gap-0.5 p-0\">\n {menu.children.map((item) => (\n <li><a href={item.href} class=\"block truncate rounded-md px-2 py-1.5 text-sm text-muted-foreground no-underline hover:bg-accent hover:text-foreground\">{item.label}</a></li>\n ))}\n </ul>\n )}\n </li>\n ))}\n {submitHref && (\n <li class=\"border-t border-border pt-3\">\n <a href={submitHref} class={buttonClass(\"primary\", \"md\", \"w-full justify-center\")}>{submitLabel ?? \"Submit\"}</a>\n </li>\n )}\n </ul>\n </nav>\n </details>\n\n {submitHref && (\n <a\n href={submitHref}\n class={buttonClass(\"primary\", \"sm\", \"max-sm:!hidden\")}\n >\n <svg\n viewBox=\"0 0 16 16\"\n width=\"13\"\n height=\"13\"\n aria-hidden=\"true\"\n fill=\"currentColor\"\n >\n <path d=\"M7.75 2a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 7.75 2Z\"></path>\n </svg>\n <span>{submitLabel ?? \"Submit\"}</span>\n </a>\n )}\n\n {site.repoUrl && (\n <a\n href={site.repoUrl}\n target=\"_blank\"\n rel=\"noopener\"\n aria-label={`${repoLabel} on GitHub${starsLabel ? ` — ${starsLabel} stars` : \"\"}`}\n title={`${repoLabel} on GitHub`}\n class={buttonClass(\"secondary\", \"bare\", \"h-8 overflow-hidden p-0 text-sm\")}\n >\n <span class=\"flex items-center gap-1.5 px-2.5 py-1.5 text-ink-900 dark:text-ink-100\">\n <svg viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" aria-hidden=\"true\" fill=\"currentColor\">\n <path d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38v-1.33c-2.22.48-2.69-1.07-2.69-1.07-.36-.92-.89-1.17-.89-1.17-.73-.5.05-.49.05-.49.8.06 1.23.83 1.23.83.72 1.22 1.87.87 2.33.67.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48v2.19c0 .21.15.46.55.38A8 8 0 0 0 8 0Z\"></path>\n </svg>\n <span class=\"hidden lg:inline\">{repoLabel}</span>\n </span>\n {starsLabel && <span class=\"hidden items-center gap-1 border-s border-border bg-secondary px-2 py-1.5 text-secondary-foreground sm:flex\">\n <svg viewBox=\"0 0 16 16\" width=\"11\" height=\"11\" aria-hidden=\"true\" fill=\"currentColor\" class=\"text-warning\">\n <path d=\"M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Z\"></path>\n </svg>\n <span class=\"font-mono\">{starsLabel}</span>\n </span>}\n </a>\n )}\n\n <ThemeToggle />\n </div>\n </div>\n</header>\n\n<script>\n // Nav menus are <details>: one open at a time, closed by Escape,\n // an outside click, or following a link inside the panel.\n const menus = [...document.querySelectorAll<HTMLDetailsElement>(\"[data-nav-menu]\")];\n const closeAll = (except?: HTMLDetailsElement) =>\n menus.forEach((menu) => { if (menu !== except) menu.open = false; });\n menus.forEach((menu) => {\n menu.addEventListener(\"toggle\", () => { if (menu.open) closeAll(menu); });\n menu.addEventListener(\"click\", (e) => {\n if ((e.target as HTMLElement).closest(\"a\")) menu.open = false;\n });\n });\n document.addEventListener(\"click\", (e) => {\n if (!(e.target as HTMLElement).closest(\"[data-nav-menu]\")) closeAll();\n });\n document.addEventListener(\"keydown\", (e) => {\n if (e.key !== \"Escape\") return;\n const open = menus.find((menu) => menu.open);\n if (!open) return;\n open.open = false;\n open.querySelector(\"summary\")?.focus();\n });\n\n // Smooth-scroll for in-page anchor links (Header nav + Hero CTA).\n // Works on any <a href=\"#…\"> that points to an existing element on\n // the current page. External links (e.g. /about, /projects?…) are\n // skipped because they don't start with \"#\". Modifier-clicks\n // (Cmd/Ctrl/Shift/middle) let the browser handle the anchor\n // normally so users can open the same section in a new tab.\n document.addEventListener(\"click\", (e) => {\n if (e.defaultPrevented) return;\n if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;\n if (e.button !== 0) return;\n const link = (e.target as HTMLElement).closest<HTMLAnchorElement>(\n 'a[href^=\"#\"]',\n );\n if (!link) return;\n const id = link.getAttribute(\"href\")!;\n if (id.length <= 1) return;\n const target = document.querySelector(id);\n if (!target) return;\n e.preventDefault();\n target.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n history.replaceState(null, \"\", id);\n });\n</script>\n",
37
37
  "type": "registry:component",
38
38
  "target": "~/src/layouts/header.astro"
39
39
  },
@@ -45,7 +45,7 @@
45
45
  },
46
46
  {
47
47
  "path": "default/layouts/seo.astro",
48
- "content": "---\n// SPDX-License-Identifier: MIT\n\n/**\n * Per-page SEO: <title>, description, canonical, Open Graph, Twitter Card,\n * and JSON-LD structured data. Designed to be used inside <head> by the\n * BaseLayout. Pages pass the rich props they care about; everything else\n * has a sensible default derived from the site config and the Astro URL.\n *\n * Renders:\n * - <title>, meta description, canonical link, robots\n * - Open Graph (og:*) for Facebook, LinkedIn, Discord, Slack, etc.\n * - Twitter Card (twitter:*) for X / Twitter\n * - JSON-LD WebSite+Organization identity graph on every page\n * (built by @grove-dev/core's `siteSchema`, with a SearchAction\n * pointing at the directory's browse page)\n * - Per-page JSON-LD nodes when `jsonLd` is provided (SoftwareApplication\n * on record pages, CollectionPage/ItemList/BreadcrumbList on\n * collection and taxonomy pages, ...)\n *\n * Noindex is opt-in via the `noindex` prop. By default everything is\n * indexable; noindex targets today are /submit, /404, and /empty.\n * `robots` sets the exact value instead — page models pass\n * `noindex,follow` for pages the index policy (`seo.*IndexPolicy`)\n * excludes, so their links are still followed.\n *\n * Any URL with a query string (`?q=`, `?sort=`, facet filters) is a\n * filtered view of a static page: the server sends the base page's\n * HTML, canonical included. A small inline script switches the robots\n * meta to `noindex,follow` on those URLs so the variant itself is not\n * indexed; Google renders JavaScript and honours a robots meta the page\n * sets at runtime. A server-side `X-Robots-Tag` is stronger where the\n * host allows it (see the SEO docs).\n */\nimport { type JsonLdNode, siteSchema, validateJsonLd } from '@grove-dev/core';\n\ninterface Props {\n title: string;\n description: string;\n site: {\n name: string;\n description?: string;\n repoUrl?: string;\n /** Header logo path under `public/` — used as Organization logo when set. */\n logo?: string;\n /** BCP-47 language tag (e.g. \"en\"). Drives og:locale + JSON-LD inLanguage. */\n locale?: string;\n /** Twitter/X handle (e.g. \"@grove\") — emitted as twitter:site. */\n twitter?: string;\n };\n searchPath?: string;\n /** Open Graph / Twitter image. Default: /og-image.svg. Should be absolute or root-relative. */\n image?: string;\n /** Alt text for the OG/Twitter image. Default: \"<site name> social preview\". */\n imageAlt?: string;\n /** og:type. Default: \"website\". Use \"article\" for blog posts / changelog. */\n type?: 'website' | 'article' | 'profile';\n /** Set true to add noindex,nofollow. */\n noindex?: boolean;\n /** Exact robots meta value (e.g. \"noindex,follow\"); wins over `noindex`. */\n robots?: string;\n /** Extra JSON-LD payload (object) — typically SoftwareSourceCode on item pages. */\n jsonLd?: Record<string, unknown> | Record<string, unknown>[];\n}\n\nconst {\n title,\n description,\n site: siteConfig,\n searchPath = '/items',\n image = '/og-image.svg',\n imageAlt,\n type = 'website',\n noindex = false,\n robots,\n jsonLd,\n} = Astro.props;\nconst robotsContent =\n robots ?? (noindex ? 'noindex,nofollow' : 'index,follow,max-image-preview:large');\n\n// `Astro.site` is required for canonical / OG / Twitter / JSON-LD URLs to\n// resolve to the consumer's domain. Failing the build (rather than silently\n// emitting `https://example.com/...`) is the right call: every canonical,\n// OG, and JSON-LD URL would otherwise leak to a domain the consumer doesn't\n// own, which search engines either ignore or treat as canonical to the\n// wrong host.\nif (!Astro.site) {\n throw new Error(\n \"Seo: `site` is not set on the Astro config. Add `site: 'https://your-domain'` to astro.config.mjs so canonical / Open Graph / Twitter / JSON-LD URLs resolve correctly.\",\n );\n}\nconst siteUrl = Astro.site;\nconst canonical = new URL(Astro.url.pathname, siteUrl).toString();\nconst ogImage = new URL(image, siteUrl).toString();\nconst ogImageAlt = imageAlt ?? `${siteConfig.name} social preview`;\nconst locale = siteConfig.locale ?? 'en';\n\n// Truncate description for OG/Twitter where longer is worse (160–200 chars).\nfunction truncate(s: string, max: number): string {\n if (s.length <= max) return s;\n return s.slice(0, max - 1).trimEnd() + '…';\n}\nconst shortDescription = truncate(description, 200);\n\n// WebSite+Organization identity graph — site-wide signals that appear on\n// every page (Google uses them for site links and the knowledge panel).\n// Built by core's `siteSchema` so the @id graph shape is shared with the\n// rest of the JSON-LD registry; the SearchAction is appended here because\n// the browse path is an adapter concern, not a core one.\nconst bareSiteUrl = siteUrl.toString().replace(/\\/$/, '');\nconst [siteLd] = siteSchema({\n url: bareSiteUrl,\n name: siteConfig.name,\n description: siteConfig.description ?? description,\n inLanguage: locale,\n orgName: siteConfig.name,\n orgUrl: bareSiteUrl,\n ...(siteConfig.logo ? { orgLogo: new URL(siteConfig.logo, siteUrl).toString() } : {}),\n ...(siteConfig.repoUrl ? { sameAs: [siteConfig.repoUrl] } : {}),\n});\nsiteLd.potentialAction = {\n '@type': 'SearchAction',\n target: `${bareSiteUrl}${searchPath}?q={search_term_string}`,\n 'query-input': 'required name=search_term_string',\n};\n\nconst perPageNodes = jsonLd ? (Array.isArray(jsonLd) ? jsonLd : [jsonLd]) : null;\n\n// Dev-only well-formedness check — surfaces malformed nodes (relative\n// URLs, missing @context, duplicate @ids) in the terminal during\n// `astro dev` without ever failing or slowing a production build.\nif (import.meta.env.DEV && perPageNodes) {\n const issues = validateJsonLd(perPageNodes as JsonLdNode[]);\n for (const issue of issues) {\n console.warn(`[grove seo] ${Astro.url.pathname}: ${issue.message}`);\n }\n}\n\n// Pre-stringify the JSON-LD payloads in the frontmatter so the\n// template body just interpolates the resulting strings. For SSR\n// this saves the JSON.stringify call on every render; for static\n// builds the cost is unchanged but the template reads cleaner.\nconst siteLdJson = JSON.stringify(siteLd);\nconst perPageLdJson = perPageNodes ? JSON.stringify(perPageNodes) : null;\n---\n\n<!-- Primary meta -->\n<title>{title}</title>\n<meta name=\"description\" content={description} />\n<link rel=\"canonical\" href={canonical} />\n<meta name=\"robots\" content={robotsContent} />\n<!-- Filtered / parameter URLs: noindex the variant, canonical stays the base page. -->\n<script is:inline data-grove-param-robots>\n if (location.search) {\n document.querySelector('meta[name=\"robots\"]')?.setAttribute('content', 'noindex,follow');\n }\n</script>\n\n<!-- Open Graph -->\n<meta property=\"og:type\" content={type} />\n<meta property=\"og:url\" content={canonical} />\n<meta property=\"og:title\" content={title} />\n<meta property=\"og:description\" content={shortDescription} />\n<meta property=\"og:image\" content={ogImage} />\n<meta property=\"og:image:width\" content=\"1200\" />\n<meta property=\"og:image:height\" content=\"630\" />\n<meta property=\"og:image:alt\" content={ogImageAlt} />\n<meta property=\"og:site_name\" content={siteConfig.name} />\n<meta property=\"og:locale\" content={locale} />\n\n<!-- Twitter Card -->\n<meta name=\"twitter:card\" content=\"summary_large_image\" />\n{siteConfig.twitter && <meta name=\"twitter:site\" content={siteConfig.twitter} />}\n<meta name=\"twitter:title\" content={title} />\n<meta name=\"twitter:description\" content={shortDescription} />\n<meta name=\"twitter:image\" content={ogImage} />\n<meta name=\"twitter:image:alt\" content={ogImageAlt} />\n\n<!-- JSON-LD: site-wide identity graph -->\n<script is:inline type=\"application/ld+json\" set:html={siteLdJson} />\n\n<!-- JSON-LD: per-page (SoftwareApplication, CollectionPage, BreadcrumbList, ...) -->\n{perPageLdJson && (\n <script\n is:inline\n type=\"application/ld+json\"\n set:html={perPageLdJson}\n />\n)}\n",
48
+ "content": "---\n// SPDX-License-Identifier: MIT\n\n/**\n * Per-page SEO: <title>, description, canonical, Open Graph, Twitter Card,\n * and JSON-LD structured data. Designed to be used inside <head> by the\n * BaseLayout. Pages pass the rich props they care about; everything else\n * has a sensible default derived from the site config and the Astro URL.\n *\n * Renders:\n * - <title>, meta description, canonical link, robots\n * - Open Graph (og:*) for Facebook, LinkedIn, Discord, Slack, etc.\n * - Twitter Card (twitter:*) for X / Twitter\n * - JSON-LD WebSite+Organization identity graph on every page\n * (built by @grove-dev/core's `siteSchema`, with a SearchAction\n * pointing at the directory's browse page)\n * - Per-page JSON-LD nodes when `jsonLd` is provided (SoftwareApplication\n * on record pages, CollectionPage/ItemList/BreadcrumbList on\n * collection and taxonomy pages, ...)\n *\n * Noindex is opt-in via the `noindex` prop. By default everything is\n * indexable; noindex targets today are /submit, /404, and /empty.\n * `robots` sets the exact value instead — page models pass\n * `noindex,follow` for pages the index policy (`seo.*IndexPolicy`)\n * excludes, so their links are still followed.\n *\n * Any URL with a query string (`?q=`, `?sort=`, facet filters) is a\n * filtered view of a static page: the server sends the base page's\n * HTML, canonical included. A small inline script switches the robots\n * meta to `noindex,follow` on those URLs so the variant itself is not\n * indexed; Google renders JavaScript and honours a robots meta the page\n * sets at runtime. A server-side `X-Robots-Tag` is stronger where the\n * host allows it (see the SEO docs).\n */\nimport { type JsonLdNode, siteSchema, validateJsonLd } from '@grove-dev/core';\n\ninterface Props {\n title: string;\n description: string;\n site: {\n name: string;\n description?: string;\n repoUrl?: string;\n /** Header logo path under `public/` — used as Organization logo when set. */\n logo?: string;\n /** BCP-47 language tag (e.g. \"en\"). Drives og:locale + JSON-LD inLanguage. */\n locale?: string;\n /** Twitter/X handle (e.g. \"@grove\") — emitted as twitter:site. */\n twitter?: string;\n };\n searchPath?: string;\n /** Open Graph / Twitter image. Default: /og-image.svg. Should be absolute or root-relative. */\n image?: string;\n /** Alt text for the OG/Twitter image. Default: \"<site name> social preview\". */\n imageAlt?: string;\n /** og:type. Default: \"website\". Use \"article\" for blog posts / changelog. */\n type?: 'website' | 'article' | 'profile';\n /** Set true to add noindex,nofollow. */\n noindex?: boolean;\n /** Exact robots meta value (e.g. \"noindex,follow\"); wins over `noindex`. */\n robots?: string;\n /** Extra JSON-LD payload (object) — typically SoftwareSourceCode on item pages. */\n jsonLd?: Record<string, unknown> | Record<string, unknown>[];\n}\n\nconst {\n title,\n description,\n site: siteConfig,\n searchPath = '/items',\n image = '/og-image.svg',\n imageAlt,\n type = 'website',\n noindex = false,\n robots,\n jsonLd,\n} = Astro.props;\nconst robotsContent =\n robots ?? (noindex ? 'noindex,nofollow' : 'index,follow,max-image-preview:large');\n\n// `Astro.site` is required for canonical / OG / Twitter / JSON-LD URLs to\n// resolve to the consumer's domain. Failing the build (rather than silently\n// emitting `https://example.com/...`) is the right call: every canonical,\n// OG, and JSON-LD URL would otherwise leak to a domain the consumer doesn't\n// own, which search engines either ignore or treat as canonical to the\n// wrong host.\nif (!Astro.site) {\n throw new Error(\n \"Seo: `site` is not set on the Astro config. Add `site: 'https://your-domain'` to astro.config.mjs so canonical / Open Graph / Twitter / JSON-LD URLs resolve correctly.\",\n );\n}\nconst siteUrl = Astro.site;\nconst canonical = new URL(Astro.url.pathname, siteUrl).toString();\nconst ogImage = new URL(image, siteUrl).toString();\nconst ogImageAlt = imageAlt ?? `${siteConfig.name} social preview`;\nconst locale = siteConfig.locale ?? 'en';\n\n// Truncate description for OG/Twitter where longer is worse (160–200 chars).\nfunction truncate(s: string, max: number): string {\n if (s.length <= max) return s;\n return `${s.slice(0, max - 1).trimEnd()}…`;\n}\nconst shortDescription = truncate(description, 200);\n\n// WebSite+Organization identity graph — site-wide signals that appear on\n// every page (Google uses them for site links and the knowledge panel).\n// Built by core's `siteSchema` so the @id graph shape is shared with the\n// rest of the JSON-LD registry; the SearchAction is appended here because\n// the browse path is an adapter concern, not a core one.\nconst bareSiteUrl = siteUrl.toString().replace(/\\/$/, '');\nconst [siteLd] = siteSchema({\n url: bareSiteUrl,\n name: siteConfig.name,\n description: siteConfig.description ?? description,\n inLanguage: locale,\n orgName: siteConfig.name,\n orgUrl: bareSiteUrl,\n ...(siteConfig.logo ? { orgLogo: new URL(siteConfig.logo, siteUrl).toString() } : {}),\n ...(siteConfig.repoUrl ? { sameAs: [siteConfig.repoUrl] } : {}),\n});\nsiteLd.potentialAction = {\n '@type': 'SearchAction',\n target: `${bareSiteUrl}${searchPath}?q={search_term_string}`,\n 'query-input': 'required name=search_term_string',\n};\n\nconst perPageNodes = jsonLd ? (Array.isArray(jsonLd) ? jsonLd : [jsonLd]) : null;\n\n// Dev-only well-formedness check — surfaces malformed nodes (relative\n// URLs, missing @context, duplicate @ids) in the terminal during\n// `astro dev` without ever failing or slowing a production build.\nif (import.meta.env.DEV && perPageNodes) {\n const issues = validateJsonLd(perPageNodes as JsonLdNode[]);\n for (const issue of issues) {\n console.warn(`[grove seo] ${Astro.url.pathname}: ${issue.message}`);\n }\n}\n\n// Pre-stringify the JSON-LD payloads in the frontmatter so the\n// template body just interpolates the resulting strings. For SSR\n// this saves the JSON.stringify call on every render; for static\n// builds the cost is unchanged but the template reads cleaner.\nconst siteLdJson = JSON.stringify(siteLd);\nconst perPageLdJson = perPageNodes ? JSON.stringify(perPageNodes) : null;\n---\n\n<!-- Primary meta -->\n<title>{title}</title>\n<meta name=\"description\" content={description} />\n<link rel=\"canonical\" href={canonical} />\n<meta name=\"robots\" content={robotsContent} />\n<!-- Filtered / parameter URLs: noindex the variant, canonical stays the base page. -->\n<script is:inline data-grove-param-robots>\n if (location.search) {\n document.querySelector('meta[name=\"robots\"]')?.setAttribute('content', 'noindex,follow');\n }\n</script>\n\n<!-- Open Graph -->\n<meta property=\"og:type\" content={type} />\n<meta property=\"og:url\" content={canonical} />\n<meta property=\"og:title\" content={title} />\n<meta property=\"og:description\" content={shortDescription} />\n<meta property=\"og:image\" content={ogImage} />\n<meta property=\"og:image:width\" content=\"1200\" />\n<meta property=\"og:image:height\" content=\"630\" />\n<meta property=\"og:image:alt\" content={ogImageAlt} />\n<meta property=\"og:site_name\" content={siteConfig.name} />\n<meta property=\"og:locale\" content={locale} />\n\n<!-- Twitter Card -->\n<meta name=\"twitter:card\" content=\"summary_large_image\" />\n{siteConfig.twitter && <meta name=\"twitter:site\" content={siteConfig.twitter} />}\n<meta name=\"twitter:title\" content={title} />\n<meta name=\"twitter:description\" content={shortDescription} />\n<meta name=\"twitter:image\" content={ogImage} />\n<meta name=\"twitter:image:alt\" content={ogImageAlt} />\n\n<!-- JSON-LD: site-wide identity graph -->\n<script is:inline type=\"application/ld+json\" set:html={siteLdJson} />\n\n<!-- JSON-LD: per-page (SoftwareApplication, CollectionPage, BreadcrumbList, ...) -->\n{perPageLdJson && (\n <script\n is:inline\n type=\"application/ld+json\"\n set:html={perPageLdJson}\n />\n)}\n",
49
49
  "type": "registry:component",
50
50
  "target": "~/src/layouts/seo.astro"
51
51
  },
@@ -69,8 +69,8 @@
69
69
  }
70
70
  ],
71
71
  "meta": {
72
- "version": "1.4.0",
73
- "requiresGrove": "0.19.0"
72
+ "version": "1.5.0",
73
+ "requiresGrove": "1.0.1"
74
74
  },
75
75
  "type": "registry:block"
76
76
  }