@grove-dev/cli 1.3.1 → 1.4.0

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.
@@ -54,7 +54,7 @@
54
54
  },
55
55
  {
56
56
  "path": "default/layouts/base-layout.astro",
57
- "content": "---\n/**\n * BaseLayout — wraps every page. Owns the theme-detection inline\n * script and the global shell (Header, Footer). Per-page SEO\n * (title, description, OG, JSON-LD) is delegated to `<Seo />` so\n * each page can declare what it needs without polluting the layout\n * file.\n *\n * Generic: takes a `site` prop with brand + nav + stats. No\n * `siteConfig` import — consumers compose the props from their\n * own config (typically `data/generated/site-config.json` for the\n * showcase).\n *\n * GA4 can be configured once through `site.analytics.googleAnalyticsId`\n * or overridden per page with `gaId`. Omit both for privacy-first deployments.\n */\nimport '../styles/system.css';\nimport { derivePrimaryPalette } from '@grove-dev/astro/server';\nimport Footer from './footer.astro';\nimport Header from './header.astro';\nimport Seo from './seo.astro';\n\ninterface NavItem {\n label: string;\n href: string;\n}\n\ninterface SiteStats {\n totalApps?: number;\n totalCategories?: number;\n totalStacks?: number;\n totalOwners?: number;\n totalStars?: number;\n repositoryStars?: number;\n repositoryForks?: number;\n repositoryContributors?: number;\n originalRepo?: string;\n originalStars?: number;\n originalForks?: number;\n originalContributors?: number;\n}\n\ninterface Site {\n name: string;\n tagline?: string;\n description?: string;\n nav: NavItem[];\n footer?: {\n columns?: Array<{\n heading: string;\n items: Array<{ label: string; href: string; external?: boolean }>;\n }>;\n copyright?: string;\n license?: string;\n };\n submission?: {\n eyebrow?: string;\n title?: string;\n description?: string;\n good?: string[];\n avoid?: string[];\n };\n repoUrl?: string;\n url?: string;\n /** Header logo path under `public/` (e.g. `/logo.svg`). */\n logo?: string;\n /** Favicon path under `public/` (e.g. `/favicon.svg`). */\n favicon?: string;\n /** BCP-47 language tag (e.g. \"en\"). Drives `<html lang>` and og:locale. */\n locale?: string;\n /** Twitter/X handle (e.g. \"@grove\") — emitted as twitter:site. */\n twitter?: string;\n analytics?: {\n googleAnalyticsId?: string;\n };\n /** Optional directory-level stats — populated from site-config.json\n * at generate time. Components use it to render hero counts,\n * origin card stats, and footer summary lines. */\n stats?: SiteStats;\n /** Theme knobs from grove.config.ts — resolved into CSS custom\n * properties on `<html>` so the package stylesheet picks them up.\n * Values are plain strings because the prop usually arrives from a\n * JSON import; unknown values fall back to the package defaults. */\n theme?: {\n primaryColor?: string;\n /** \"none\" | \"soft\" | \"round\" */\n radius?: string;\n /** \"compact\" | \"comfortable\" | \"spacious\" */\n density?: string;\n containerWidth?: string;\n };\n blueprintConfig?: {\n routeSlug?: string;\n labelSingular?: string;\n labelPlural?: string;\n };\n}\n\ninterface Props {\n title: string;\n description: string;\n site: Site;\n type?: 'website' | 'article' | 'profile';\n noindex?: boolean;\n /** Exact robots meta value (e.g. a page model's `seo.robots`); wins over `noindex`. */\n robots?: string;\n jsonLd?: Record<string, unknown> | Record<string, unknown>[];\n /** Open Graph / Twitter image path (e.g. \"/og/records/foo.png\").\n * Defaults to the site-wide /og-image.svg inside <Seo />. */\n image?: string;\n /** Alt text for the OG/Twitter image. */\n imageAlt?: string;\n /** Optional Google Analytics 4 Measurement ID (e.g. \"G-XXXXXX\"). */\n gaId?: string;\n /** Directory browse path for \"Browse all\" links. Defaults to the blueprint route. */\n searchPath?: string;\n /** Submit button label rendered in the header. Omit to hide. */\n submitLabel?: string;\n /** Submit button href rendered in the header. */\n submitHref?: string;\n}\n\nconst {\n title,\n description,\n site,\n type,\n noindex,\n robots,\n jsonLd,\n image,\n imageAlt,\n gaId,\n searchPath,\n submitLabel,\n submitHref,\n} = Astro.props;\nconst directoryPath = searchPath ?? `/${site.blueprintConfig?.routeSlug ?? 'items'}`;\nconst effectiveGaId = gaId ?? site.analytics?.googleAnalyticsId;\n\n// ── Theme wiring ─────────────────────────────────────────────────\n// `theme.*` from grove.config.ts resolves to CSS custom properties\n// on the <html> style attribute. An attribute (not an inline\n// <style>) so the override wins over the bundled stylesheet\n// regardless of how Vite orders the CSS output.\nconst RADIUS_PRESETS: Record<string, [string, string, string]> = {\n none: ['0rem', '0rem', '0rem'],\n soft: ['0.625rem', '0.5rem', '0.75rem'],\n round: ['0.875rem', '0.75rem', '1rem'],\n};\nconst DENSITY_SPACING: Record<string, string> = {\n compact: '0.225rem',\n comfortable: '0.25rem',\n spacious: '0.28rem',\n};\n\n// Brand fill and text derive from ONE WCAG computation (contrast.ts)\n// so background and foreground can never drift apart across themes.\n\nconst themeConfig = site.theme;\nconst themeStyleParts: string[] = [];\nif (themeConfig) {\n const radius = RADIUS_PRESETS[themeConfig.radius ?? 'soft'];\n if (radius && themeConfig.radius && themeConfig.radius !== 'soft') {\n themeStyleParts.push(\n `--grove-radius: ${radius[0]}`,\n `--grove-radius-lg: ${radius[1]}`,\n `--grove-radius-xl: ${radius[2]}`,\n );\n }\n const spacing = DENSITY_SPACING[themeConfig.density ?? 'comfortable'];\n if (spacing && themeConfig.density && themeConfig.density !== 'comfortable') {\n themeStyleParts.push(`--spacing: ${spacing}`);\n }\n if (themeConfig.containerWidth) {\n themeStyleParts.push(`--grove-container: ${themeConfig.containerWidth}`);\n }\n const primary = themeConfig.primaryColor;\n if (typeof primary === 'string' && /^#[0-9a-fA-F]{3,8}$/.test(primary)) {\n const palette = derivePrimaryPalette(primary);\n if (palette) {\n themeStyleParts.push(\n `--grove-theme-primary: ${palette.solid}`,\n `--grove-theme-primary-foreground: ${palette.solidForeground}`,\n `--grove-theme-primary-dark: ${palette.dark}`,\n `--grove-theme-primary-dark-foreground: ${palette.darkForeground}`,\n );\n }\n }\n}\nconst themeStyle = themeStyleParts.length > 0 ? `${themeStyleParts.join('; ')};` : undefined;\n\n// `site.favicon` points at a file the consumer owns under `public/`.\n// The fallback is a generated square — tinted with the configured\n// brand color rather than a hardcoded near-black, so an unconfigured\n// site still gets a tab mark that is recognisably its own.\nconst faviconFill = (site.theme?.primaryColor ?? '#18181b').trim();\nconst favicon =\n site.favicon ??\n `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect width='16' height='16' rx='3' fill='${encodeURIComponent(faviconFill)}'/%3E%3C/svg%3E`;\n---\n\n<!doctype html>\n<html lang={site.locale ?? 'en'} style={themeStyle}>\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta name=\"generator\" content={Astro.generator} />\n <meta name=\"theme-color\" content=\"#0a0a0c\" media=\"(prefers-color-scheme: dark)\" />\n <meta name=\"theme-color\" content=\"#fafafa\" media=\"(prefers-color-scheme: light)\" />\n <link rel=\"icon\" href={favicon} />\n <link rel=\"sitemap\" href=\"/sitemap.xml\" />\n {/* Preconnect to GitHub's avatar CDN — most pages render at least\n one avatar (record list cards, detail page logo) and the\n connection is reusable across cards. Cross-origin only, no\n document fetch, so the cost is one TLS handshake per page. */}\n <link rel=\"preconnect\" href=\"https://avatars.githubusercontent.com\" crossorigin=\"anonymous\" />\n <link\n rel=\"alternate\"\n type=\"text/plain\"\n href=\"/llms.txt\"\n title=\"LLM usage guidance\"\n />\n\n {effectiveGaId && (\n <>\n <script\n is:inline\n async\n src={`https://www.googletagmanager.com/gtag/js?id=${effectiveGaId}`}\n />\n <script is:inline define:vars={{ gaId: effectiveGaId }}>\n window.dataLayer = window.dataLayer || [];\n // define:vars wraps this script in a function, so a plain\n // `function gtag` would stay local; the Back/Forward handler at\n // the end of <body> needs it on window.\n window.gtag = function gtag() {\n dataLayer.push(arguments);\n };\n gtag(\"js\", new Date());\n gtag(\"config\", gaId, {\n page_path: window.location.pathname + window.location.search,\n page_title: document.title,\n });\n </script>\n </>\n )}\n\n <Seo\n title={title}\n description={description}\n type={type}\n noindex={noindex}\n robots={robots}\n jsonLd={jsonLd}\n {...(image ? { image } : {})}\n imageAlt={imageAlt}\n site={site}\n />\n\n <slot name=\"head\" />\n\n <script is:inline>\n // THEME_INIT — runs before paint so the user never sees a\n // flash of the wrong theme. State is persisted in localStorage\n // under the key \"grove-theme\" (matching ThemeToggle.astro).\n (function () {\n var STORAGE_KEY = \"grove-theme\";\n function getMode() {\n try {\n var stored = localStorage.getItem(STORAGE_KEY);\n if (stored === \"light\" || stored === \"dark\" || stored === \"system\")\n return stored;\n } catch (e) {\n // localStorage may be blocked (private mode, etc.) —\n // fall through to the system default.\n }\n return \"system\";\n }\n function apply(mode) {\n var resolved =\n mode === \"system\"\n ? (window.matchMedia(\"(prefers-color-scheme: dark)\").matches\n ? \"dark\"\n : \"light\")\n : mode;\n var root = document.documentElement;\n if (resolved === \"dark\") root.classList.add(\"dark\");\n else root.classList.remove(\"dark\");\n root.dataset.theme = mode;\n root.dataset.resolvedTheme = resolved;\n }\n apply(getMode());\n window.addEventListener(\"theme:set\", function (e) {\n apply(e.detail);\n });\n var mq = window.matchMedia(\"(prefers-color-scheme: dark)\");\n mq.addEventListener(\"change\", function () {\n if (getMode() === \"system\") apply(\"system\");\n });\n })();\n </script>\n </head>\n <body class=\"min-h-screen bg-background text-foreground\">\n <a\n href=\"#main\"\n class=\"sr-only z-50 rounded-md bg-background px-3 py-2 text-sm font-medium text-foreground outline-none ring-2 ring-ring focus:not-sr-only focus:fixed focus:left-3 focus:top-3\"\n >\n Skip to content\n </a>\n <slot name=\"header\">\n <Header\n site={site}\n submitLabel={submitLabel ?? (site.blueprintConfig ? `Submit ${site.blueprintConfig.labelSingular ?? \"item\"}` : undefined)}\n submitHref={submitHref ?? (site.blueprintConfig ? \"/submit\" : undefined)}\n />\n </slot>\n\n <main id=\"main\">\n <slot />\n </main>\n\n <slot name=\"footer\">\n <Footer\n site={site}\n stats={{\n totalApps: site.stats?.totalApps,\n totalCategories: site.stats?.totalCategories,\n totalStacks: site.stats?.totalStacks,\n totalOwners: site.stats?.totalOwners,\n }}\n itemsLabel={site.blueprintConfig?.labelPlural ?? \"items\"}\n discover={{\n heading: \"Discover\",\n items: [\n ...(site.stats?.totalApps\n ? [{ label: \"Browse all\", href: directoryPath }]\n : []),\n { label: \"Community\", href: \"/contributors\" },\n ...(site.stats?.originalRepo\n ? [{ label: \"View on GitHub\", href: site.stats.originalRepo, external: true }]\n : []),\n ],\n }}\n contribute={{\n heading: \"Contribute\",\n items: [\n ...(site.repoUrl\n ? [\n {\n label: \"Submit via GitHub\",\n href: `${site.repoUrl}/blob/main/CONTRIBUTING.md`,\n external: true,\n },\n ]\n : []),\n ...(site.repoUrl\n ? [\n {\n label: \"Report an issue\",\n href: `${site.repoUrl}/issues`,\n external: true,\n },\n ]\n : []),\n ],\n }}\n project={{\n heading: \"Project\",\n items: [\n ...(site.repoUrl\n ? [\n {\n label: \"Source on GitHub\",\n href: site.repoUrl,\n external: true,\n },\n ]\n : []),\n ...(site.repoUrl\n ? [\n {\n label: \"Changelog\",\n href: `${site.repoUrl}/blob/main/CHANGELOG.md`,\n external: true,\n },\n ]\n : []),\n ],\n }}\n />\n </slot>\n\n <slot name=\"body-end\" />\n\n {effectiveGaId && (\n <script is:inline define:vars={{ gaId: effectiveGaId }}>\n (function () {\n // GA4's `gtag('config', id)` call in the <head> already auto-pings\n // `page_view` on full navigations, so this block only needs to\n // catch history changes (back/forward). No history.pushState /\n // replaceState wrap: the package does not install\n // @astrojs/transitions' ClientRouter, and those wraps\n // double-fired page_view events on every navigation.\n var last = location.pathname + location.search;\n function report() {\n var next = location.pathname + location.search;\n if (next === last || typeof window.gtag !== \"function\") return;\n last = next;\n window.gtag(\"event\", \"page_view\", {\n page_path: next,\n page_title: document.title,\n page_location: location.href,\n });\n }\n window.addEventListener(\"popstate\", report);\n\n // Links and cards carry `data-event` (+ optional\n // `data-event-source` / `data-event-item`); send each click as a\n // GA event so installs and outbound clicks per record are counted.\n document.addEventListener(\"click\", function (e) {\n var el = e.target instanceof Element ? e.target.closest(\"[data-event]\") : null;\n if (!el || typeof window.gtag !== \"function\") return;\n window.gtag(\"event\", el.getAttribute(\"data-event\"), {\n event_source: el.getAttribute(\"data-event-source\") || undefined,\n event_item: el.getAttribute(\"data-event-item\") || undefined,\n link_url: el.getAttribute(\"href\") || undefined,\n transport_type: \"beacon\",\n });\n });\n })();\n </script>\n )}\n </body>\n</html>\n",
57
+ "content": "---\n/**\n * BaseLayout — wraps every page. Owns the theme-detection inline\n * script and the global shell (Header, Footer). Per-page SEO\n * (title, description, OG, JSON-LD) is delegated to `<Seo />` so\n * each page can declare what it needs without polluting the layout\n * file.\n *\n * Generic: takes a `site` prop with brand + nav + stats. No\n * `siteConfig` import — consumers compose the props from their\n * own config (typically `data/generated/site-config.json` for the\n * showcase).\n *\n * GA4 can be configured once through `site.analytics.googleAnalyticsId`\n * or overridden per page with `gaId`. Omit both for privacy-first deployments.\n */\nimport '../styles/system.css';\nimport { derivePrimaryPalette } from '@grove-dev/astro/server';\nimport Footer from './footer.astro';\nimport Header from './header.astro';\nimport Seo from './seo.astro';\n\ninterface NavItem {\n label: string;\n href: string;\n}\n\ninterface SiteStats {\n totalApps?: number;\n totalCategories?: number;\n totalStacks?: number;\n totalOwners?: number;\n totalStars?: number;\n repositoryStars?: number;\n repositoryForks?: number;\n repositoryContributors?: number;\n originalRepo?: string;\n originalStars?: number;\n originalForks?: number;\n originalContributors?: number;\n}\n\ninterface Site {\n name: string;\n tagline?: string;\n description?: string;\n nav: NavItem[];\n footer?: {\n columns?: Array<{\n heading: string;\n items: Array<{ label: string; href: string; external?: boolean }>;\n }>;\n copyright?: string;\n license?: string;\n };\n submission?: {\n eyebrow?: string;\n title?: string;\n description?: string;\n good?: string[];\n avoid?: string[];\n };\n repoUrl?: string;\n url?: string;\n /** Header logo path under `public/` (e.g. `/logo.svg`). */\n logo?: string;\n /** Favicon path under `public/` (e.g. `/favicon.svg`). */\n favicon?: string;\n /** BCP-47 language tag (e.g. \"en\"). Drives `<html lang>` and og:locale. */\n locale?: string;\n /** Twitter/X handle (e.g. \"@grove\") — emitted as twitter:site. */\n twitter?: string;\n analytics?: {\n googleAnalyticsId?: string;\n };\n /** Optional directory-level stats — populated from site-config.json\n * at generate time. Components use it to render hero counts,\n * origin card stats, and footer summary lines. */\n stats?: SiteStats;\n /** Theme knobs from grove.config.ts — resolved into CSS custom\n * properties on `<html>` so the package stylesheet picks them up.\n * Values are plain strings because the prop usually arrives from a\n * JSON import; unknown values fall back to the package defaults. */\n theme?: {\n primaryColor?: string;\n /** \"none\" | \"soft\" | \"round\" */\n radius?: string;\n /** \"compact\" | \"comfortable\" | \"spacious\" */\n density?: string;\n containerWidth?: string;\n };\n blueprintConfig?: {\n routeSlug?: string;\n labelSingular?: string;\n labelPlural?: string;\n };\n}\n\ninterface Props {\n title: string;\n description: string;\n site: Site;\n type?: 'website' | 'article' | 'profile';\n noindex?: boolean;\n /** Exact robots meta value (e.g. a page model's `seo.robots`); wins over `noindex`. */\n robots?: string;\n jsonLd?: Record<string, unknown> | Record<string, unknown>[];\n /** Open Graph / Twitter image path (e.g. \"/og/records/foo.png\").\n * Defaults to the site-wide /og-image.svg inside <Seo />. */\n image?: string;\n /** Alt text for the OG/Twitter image. */\n imageAlt?: string;\n /** Optional Google Analytics 4 Measurement ID (e.g. \"G-XXXXXX\"). */\n gaId?: string;\n /** Directory browse path for \"Browse all\" links. Defaults to the blueprint route. */\n searchPath?: string;\n /** Submit button label rendered in the header. Omit to hide. */\n submitLabel?: string;\n /** Submit button href rendered in the header. */\n submitHref?: string;\n}\n\nconst {\n title,\n description,\n site,\n type,\n noindex,\n robots,\n jsonLd,\n image,\n imageAlt,\n gaId,\n searchPath,\n submitLabel,\n submitHref,\n} = Astro.props;\nconst directoryPath = searchPath ?? `/${site.blueprintConfig?.routeSlug ?? 'items'}/`;\nconst effectiveGaId = gaId ?? site.analytics?.googleAnalyticsId;\n\n// ── Theme wiring ─────────────────────────────────────────────────\n// `theme.*` from grove.config.ts resolves to CSS custom properties\n// on the <html> style attribute. An attribute (not an inline\n// <style>) so the override wins over the bundled stylesheet\n// regardless of how Vite orders the CSS output.\nconst RADIUS_PRESETS: Record<string, [string, string, string]> = {\n none: ['0rem', '0rem', '0rem'],\n soft: ['0.625rem', '0.5rem', '0.75rem'],\n round: ['0.875rem', '0.75rem', '1rem'],\n};\nconst DENSITY_SPACING: Record<string, string> = {\n compact: '0.225rem',\n comfortable: '0.25rem',\n spacious: '0.28rem',\n};\n\n// Brand fill and text derive from ONE WCAG computation (contrast.ts)\n// so background and foreground can never drift apart across themes.\n\nconst themeConfig = site.theme;\nconst themeStyleParts: string[] = [];\nif (themeConfig) {\n const radius = RADIUS_PRESETS[themeConfig.radius ?? 'soft'];\n if (radius && themeConfig.radius && themeConfig.radius !== 'soft') {\n themeStyleParts.push(\n `--grove-radius: ${radius[0]}`,\n `--grove-radius-lg: ${radius[1]}`,\n `--grove-radius-xl: ${radius[2]}`,\n );\n }\n const spacing = DENSITY_SPACING[themeConfig.density ?? 'comfortable'];\n if (spacing && themeConfig.density && themeConfig.density !== 'comfortable') {\n themeStyleParts.push(`--spacing: ${spacing}`);\n }\n if (themeConfig.containerWidth) {\n themeStyleParts.push(`--grove-container: ${themeConfig.containerWidth}`);\n }\n const primary = themeConfig.primaryColor;\n if (typeof primary === 'string' && /^#[0-9a-fA-F]{3,8}$/.test(primary)) {\n const palette = derivePrimaryPalette(primary);\n if (palette) {\n themeStyleParts.push(\n `--grove-theme-primary: ${palette.solid}`,\n `--grove-theme-primary-foreground: ${palette.solidForeground}`,\n `--grove-theme-primary-dark: ${palette.dark}`,\n `--grove-theme-primary-dark-foreground: ${palette.darkForeground}`,\n );\n }\n }\n}\nconst themeStyle = themeStyleParts.length > 0 ? `${themeStyleParts.join('; ')};` : undefined;\n\n// `site.favicon` points at a file the consumer owns under `public/`.\n// The fallback is a generated square — tinted with the configured\n// brand color rather than a hardcoded near-black, so an unconfigured\n// site still gets a tab mark that is recognisably its own.\nconst faviconFill = (site.theme?.primaryColor ?? '#18181b').trim();\nconst favicon =\n site.favicon ??\n `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect width='16' height='16' rx='3' fill='${encodeURIComponent(faviconFill)}'/%3E%3C/svg%3E`;\n---\n\n<!doctype html>\n<html lang={site.locale ?? 'en'} style={themeStyle}>\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta name=\"generator\" content={Astro.generator} />\n <meta name=\"theme-color\" content=\"#0a0a0c\" media=\"(prefers-color-scheme: dark)\" />\n <meta name=\"theme-color\" content=\"#fafafa\" media=\"(prefers-color-scheme: light)\" />\n <link rel=\"icon\" href={favicon} />\n <link rel=\"sitemap\" href=\"/sitemap.xml\" />\n {/* Preconnect to GitHub's avatar CDN — most pages render at least\n one avatar (record list cards, detail page logo) and the\n connection is reusable across cards. Cross-origin only, no\n document fetch, so the cost is one TLS handshake per page. */}\n <link rel=\"preconnect\" href=\"https://avatars.githubusercontent.com\" crossorigin=\"anonymous\" />\n <link\n rel=\"alternate\"\n type=\"text/plain\"\n href=\"/llms.txt\"\n title=\"LLM usage guidance\"\n />\n\n {effectiveGaId && (\n <>\n <script\n is:inline\n async\n src={`https://www.googletagmanager.com/gtag/js?id=${effectiveGaId}`}\n />\n <script is:inline define:vars={{ gaId: effectiveGaId }}>\n window.dataLayer = window.dataLayer || [];\n // define:vars wraps this script in a function, so a plain\n // `function gtag` would stay local; the Back/Forward handler at\n // the end of <body> needs it on window.\n window.gtag = function gtag() {\n dataLayer.push(arguments);\n };\n gtag(\"js\", new Date());\n gtag(\"config\", gaId, {\n page_path: window.location.pathname + window.location.search,\n page_title: document.title,\n });\n </script>\n </>\n )}\n\n <Seo\n title={title}\n description={description}\n type={type}\n noindex={noindex}\n robots={robots}\n jsonLd={jsonLd}\n {...(image ? { image } : {})}\n imageAlt={imageAlt}\n site={site}\n />\n\n <slot name=\"head\" />\n\n <script is:inline>\n // THEME_INIT — runs before paint so the user never sees a\n // flash of the wrong theme. State is persisted in localStorage\n // under the key \"grove-theme\" (matching ThemeToggle.astro).\n (function () {\n var STORAGE_KEY = \"grove-theme\";\n function getMode() {\n try {\n var stored = localStorage.getItem(STORAGE_KEY);\n if (stored === \"light\" || stored === \"dark\" || stored === \"system\")\n return stored;\n } catch (e) {\n // localStorage may be blocked (private mode, etc.) —\n // fall through to the system default.\n }\n return \"system\";\n }\n function apply(mode) {\n var resolved =\n mode === \"system\"\n ? (window.matchMedia(\"(prefers-color-scheme: dark)\").matches\n ? \"dark\"\n : \"light\")\n : mode;\n var root = document.documentElement;\n if (resolved === \"dark\") root.classList.add(\"dark\");\n else root.classList.remove(\"dark\");\n root.dataset.theme = mode;\n root.dataset.resolvedTheme = resolved;\n }\n apply(getMode());\n window.addEventListener(\"theme:set\", function (e) {\n apply(e.detail);\n });\n var mq = window.matchMedia(\"(prefers-color-scheme: dark)\");\n mq.addEventListener(\"change\", function () {\n if (getMode() === \"system\") apply(\"system\");\n });\n })();\n </script>\n </head>\n <body class=\"min-h-screen bg-background text-foreground\">\n <a\n href=\"#main\"\n class=\"sr-only z-50 rounded-md bg-background px-3 py-2 text-sm font-medium text-foreground outline-none ring-2 ring-ring focus:not-sr-only focus:fixed focus:left-3 focus:top-3\"\n >\n Skip to content\n </a>\n <slot name=\"header\">\n <Header\n site={site}\n submitLabel={submitLabel ?? (site.blueprintConfig ? `Submit ${site.blueprintConfig.labelSingular ?? \"item\"}` : undefined)}\n submitHref={submitHref ?? (site.blueprintConfig ? \"/submit/\" : undefined)}\n />\n </slot>\n\n <main id=\"main\">\n <slot />\n </main>\n\n <slot name=\"footer\">\n <Footer\n site={site}\n stats={{\n totalApps: site.stats?.totalApps,\n totalCategories: site.stats?.totalCategories,\n totalStacks: site.stats?.totalStacks,\n totalOwners: site.stats?.totalOwners,\n }}\n itemsLabel={site.blueprintConfig?.labelPlural ?? \"items\"}\n discover={{\n heading: \"Discover\",\n items: [\n ...(site.stats?.totalApps\n ? [{ label: \"Browse all\", href: directoryPath }]\n : []),\n { label: \"Community\", href: \"/contributors/\" },\n ...(site.stats?.originalRepo\n ? [{ label: \"View on GitHub\", href: site.stats.originalRepo, external: true }]\n : []),\n ],\n }}\n contribute={{\n heading: \"Contribute\",\n items: [\n ...(site.repoUrl\n ? [\n {\n label: \"Submit via GitHub\",\n href: `${site.repoUrl}/blob/main/CONTRIBUTING.md`,\n external: true,\n },\n ]\n : []),\n ...(site.repoUrl\n ? [\n {\n label: \"Report an issue\",\n href: `${site.repoUrl}/issues`,\n external: true,\n },\n ]\n : []),\n ],\n }}\n project={{\n heading: \"Project\",\n items: [\n ...(site.repoUrl\n ? [\n {\n label: \"Source on GitHub\",\n href: site.repoUrl,\n external: true,\n },\n ]\n : []),\n ...(site.repoUrl\n ? [\n {\n label: \"Changelog\",\n href: `${site.repoUrl}/blob/main/CHANGELOG.md`,\n external: true,\n },\n ]\n : []),\n ],\n }}\n />\n </slot>\n\n <slot name=\"body-end\" />\n\n {effectiveGaId && (\n <script is:inline define:vars={{ gaId: effectiveGaId }}>\n (function () {\n // GA4's `gtag('config', id)` call in the <head> already auto-pings\n // `page_view` on full navigations, so this block only needs to\n // catch history changes (back/forward). No history.pushState /\n // replaceState wrap: the package does not install\n // @astrojs/transitions' ClientRouter, and those wraps\n // double-fired page_view events on every navigation.\n var last = location.pathname + location.search;\n function report() {\n var next = location.pathname + location.search;\n if (next === last || typeof window.gtag !== \"function\") return;\n last = next;\n window.gtag(\"event\", \"page_view\", {\n page_path: next,\n page_title: document.title,\n page_location: location.href,\n });\n }\n window.addEventListener(\"popstate\", report);\n\n // Links and cards carry `data-event` (+ optional\n // `data-event-source` / `data-event-item`); send each click as a\n // GA event so installs and outbound clicks per record are counted.\n document.addEventListener(\"click\", function (e) {\n var el = e.target instanceof Element ? e.target.closest(\"[data-event]\") : null;\n if (!el || typeof window.gtag !== \"function\") return;\n window.gtag(\"event\", el.getAttribute(\"data-event\"), {\n event_source: el.getAttribute(\"data-event-source\") || undefined,\n event_item: el.getAttribute(\"data-event-item\") || undefined,\n link_url: el.getAttribute(\"href\") || undefined,\n transport_type: \"beacon\",\n });\n });\n })();\n </script>\n )}\n </body>\n</html>\n",
58
58
  "type": "registry:component",
59
59
  "target": "~/src/layouts/base-layout.astro"
60
60
  },
@@ -72,7 +72,7 @@
72
72
  },
73
73
  {
74
74
  "path": "default/layouts/header.astro",
75
- "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 /** Collection slugs the collections menu shows, in order. */\n featured?: string[];\n}\n\ninterface NavGroup {\n label: string;\n items: NavLink[];\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 /** Subjects name alternatives hubs in the collections menu (\"Notion\"). */\n taxonomy?: {\n subjects?: { id: string; name: 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 : [];\n// The collections menu is a shortcut, not the index: `featured` slugs (or\n// the first ten by title), titles only, and a footer link to all of them.\n// An alternatives hub (a collection with a `subject`) is named by the\n// product alone (\"Notion\") and grouped apart from the other lists.\nconst MENU_COLLECTIONS = 10;\nconst subjectNames = new Map((site.taxonomy?.subjects ?? []).map((s) => [s.id, s.name]));\nconst collectionGroups = (featured?: string[]): NavGroup[] => {\n const all = collections as { slug: string; title: string; subject?: string }[];\n const picked = featured?.length\n ? featured.flatMap((slug) => all.filter((c) => c.slug === slug))\n : [...all].sort((a, b) => a.title.localeCompare(b.title)).slice(0, MENU_COLLECTIONS);\n const hubs: NavLink[] = [];\n const lists: NavLink[] = [];\n for (const c of picked) {\n const href = `/collections/${c.slug}/`;\n const name = c.subject ? subjectNames.get(c.subject) : undefined;\n if (name) hubs.push({ label: name, href });\n else lists.push({ label: c.title, href });\n }\n return [\n { label: 'Alternatives to', items: hubs },\n { label: 'Curated lists', items: lists },\n ].filter((g) => g.items.length > 0);\n};\nconst menus = navItems.map((item) => {\n const groups = item.menu === 'collections' ? collectionGroups(item.featured) : undefined;\n const children: NavLink[] = groups ? groups.flatMap((g) => g.items) : (item.children ?? []);\n return {\n ...item,\n children,\n groups,\n footer:\n item.menu === 'collections'\n ? { label: `All ${collections.length} collections`, href: item.href }\n : 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.groups ? \"w-[30rem]\" : menu.children.length > 5 ? \"w-[34rem]\" : \"w-80\",\n ]}>\n {menu.groups ? (\n menu.groups.map((group) => (\n <div class=\"px-1 pb-1 pt-1.5\">\n <p class=\"m-0 px-2 pb-1 text-2xs font-medium uppercase tracking-wide text-muted-foreground\">{group.label}</p>\n <ul class:list={[\"m-0 grid list-none gap-0 p-0\", group.items.length > 3 ? \"grid-cols-2\" : \"grid-cols-1\"]}>\n {group.items.map((item) => (\n <li>\n <a href={item.href} aria-current={pathname === item.href ? \"page\" : undefined} class=\"block truncate rounded-[var(--radius)] px-2 py-1.5 text-sm text-foreground no-underline outline-none hover:bg-accent focus-visible:bg-accent aria-[current=page]:bg-accent\">{item.label}</a>\n </li>\n ))}\n </ul>\n </div>\n ))\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 )}\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",
75
+ "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 /** Collection slugs the collections menu shows, in order. */\n featured?: string[];\n}\n\ninterface NavGroup {\n label: string;\n items: NavLink[];\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 /** Subjects name alternatives hubs in the collections menu (\"Notion\"). */\n taxonomy?: {\n subjects?: { id: string; name: 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 : [];\n// The collections menu is a shortcut, not the index: `featured` slugs (or\n// the first ten by title), titles only, and a footer link to all of them.\n// An alternatives hub (a collection with a `subject`) is named by the\n// product alone (\"Notion\") and grouped apart from the other lists.\nconst MENU_COLLECTIONS = 10;\nconst subjectNames = new Map((site.taxonomy?.subjects ?? []).map((s) => [s.id, s.name]));\nconst collectionGroups = (featured?: string[]): NavGroup[] => {\n const all = collections as { slug: string; title: string; subject?: string }[];\n const picked = featured?.length\n ? featured.flatMap((slug) => all.filter((c) => c.slug === slug))\n : [...all].sort((a, b) => a.title.localeCompare(b.title)).slice(0, MENU_COLLECTIONS);\n const hubs: NavLink[] = [];\n const lists: NavLink[] = [];\n for (const c of picked) {\n const href = `/collections/${c.slug}/`;\n const name = c.subject ? subjectNames.get(c.subject) : undefined;\n if (name) hubs.push({ label: name, href });\n else lists.push({ label: c.title, href });\n }\n return [\n { label: 'Alternatives to', items: hubs },\n { label: 'Curated lists', items: lists },\n ].filter((g) => g.items.length > 0);\n};\nconst menus = navItems.map((item) => {\n const groups = item.menu === 'collections' ? collectionGroups(item.featured) : undefined;\n const children: NavLink[] = groups ? groups.flatMap((g) => g.items) : (item.children ?? []);\n return {\n ...item,\n children,\n groups,\n footer:\n item.menu === 'collections'\n ? { label: `All ${collections.length} collections`, href: item.href }\n : 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.groups ? \"w-[30rem]\" : menu.children.length > 5 ? \"w-[34rem]\" : \"w-80\",\n ]}>\n {menu.groups ? (\n menu.groups.map((group) => (\n <div class=\"px-1 pb-1 pt-1.5\">\n <p class=\"m-0 px-2 pb-1 text-2xs font-medium uppercase tracking-wide text-muted-foreground\">{group.label}</p>\n <ul class:list={[\"m-0 grid list-none gap-0 p-0\", group.items.length > 3 ? \"grid-cols-2\" : \"grid-cols-1\"]}>\n {group.items.map((item) => (\n <li>\n <a href={item.href} aria-current={pathname === item.href ? \"page\" : undefined} class=\"block truncate rounded-[var(--radius)] px-2 py-1.5 text-sm text-foreground no-underline outline-none hover:bg-accent focus-visible:bg-accent aria-[current=page]:bg-accent\">{item.label}</a>\n </li>\n ))}\n </ul>\n </div>\n ))\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 )}\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",
76
76
  "type": "registry:component",
77
77
  "target": "~/src/layouts/header.astro"
78
78
  },
@@ -180,13 +180,13 @@
180
180
  },
181
181
  {
182
182
  "path": "default/components/grove/stack-grid.astro",
183
- "content": "---\nimport { formatCount } from '@grove-dev/core';\nimport Icon from './icon.astro';\n\n/**\n * StackGrid — browse-by-stack grid for the home page.\n *\n * Renders a card per stack with name, blurb, status pill\n * (live/expanding/planned), and a count. The href is the list\n * page filtered to that stack, so consumers compose the URL via\n * the `hrefFor` prop.\n *\n * Generic: no blueprint-specific terms. A \"stack\" here is just a\n * slug + display name + status; consumers derive both from their\n * own data.\n */\n\ninterface StackEntry {\n name: string;\n slug: string;\n blurb?: string;\n status?: 'live' | 'expanding' | 'planned';\n count?: number;\n}\n\ninterface Props {\n stacks: StackEntry[];\n /** List page base. */\n pathPrefix?: string;\n /** Stack icon registry — maps slug → icon file name. Optional. */\n iconAliases?: Record<string, string>;\n /** Extra class. */\n class?: string;\n /** Hide the section eyebrow / header entirely. */\n bare?: boolean;\n itemLabelPlural?: string;\n /** Noun pair for count chips — singular fixes \"1 projects\". */\n itemNoun?: { singular: string; plural: string };\n /** Pass 1 when this grid IS the page (`/stacks` index). */\n level?: 1 | 2;\n /**\n * Card link builder. Defaults to the browse page filtered by stack\n * (`{pathPrefix}?stack=…`); pass e.g. `(slug) => \\`/stacks/${slug}\\``\n * to link to taxonomy detail routes instead.\n */\n hrefFor?: (slug: string) => string;\n}\n\nconst {\n stacks,\n pathPrefix = '/',\n iconAliases,\n class: className = '',\n bare = false,\n itemLabelPlural = 'items',\n itemNoun = { singular: 'item', plural: 'items' },\n level = 2,\n hrefFor,\n} = Astro.props;\n\nconst Heading = `h${level}` as 'h1' | 'h2';\n\nfunction buildHref(slug: string): string {\n if (hrefFor) return hrefFor(slug);\n const base = pathPrefix.replace(/\\/$/, '');\n return `${base}?stack=${encodeURIComponent(slug)}`;\n}\n\nfunction statusLabel(s: StackEntry['status']): string | null {\n switch (s) {\n case 'live':\n return 'Available now';\n case 'expanding':\n return 'Expanding';\n case 'planned':\n return 'Planned';\n default:\n return null;\n }\n}\n---\n\n<section\n id=\"stacks\"\n class:list={[\"py-12 sm:py-16 scroll-mt-20 border-b border-ink-200 dark:border-ink-800\", className]}\n aria-labelledby={bare ? undefined : \"grove-stackgrid-heading\"}\n>\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n {!bare && (\n <header class=\"mb-6\">\n <span class=\"text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">\n Stacks\n </span>\n <Heading\n id=\"grove-stackgrid-heading\"\n class=\"m-0 mt-1 text-[1.5rem] sm:text-[1.625rem] font-semibold tracking-tight text-ink-900 dark:text-ink-100\"\n >\n Browse by stack\n </Heading>\n <p class=\"m-0 max-w-[60ch] text-[0.9375rem] text-ink-500 dark:text-ink-400\">\n Pick a stack to see real {itemLabelPlural} built with it.\n </p>\n </header>\n )}\n\n <div class=\"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3\">\n {stacks.map((s) => (\n <a\n href={buildHref(s.slug)}\n class=\"rounded-[calc(var(--radius)+0.25rem)] border border-border bg-card shadow-none transition-colors hover:border-ink-300 dark:hover:border-ink-700 group flex h-full items-center gap-3 p-3.5 no-underline\"\n data-event=\"stack_grid_click\"\n data-event-source=\"stack_grid\"\n >\n <div class=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-ink-200 bg-white dark:border-ink-800 dark:bg-ink-950\" aria-hidden=\"true\">\n <Icon name={iconAliases?.[s.slug] ?? s.slug} category=\"stack\" size={18} />\n </div>\n\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <div class=\"flex items-center gap-2\">\n {/* Not a heading: these tiles are links in a grid, and\n heading-per-card breaks the outline when the grid\n sits directly under the page h1 (/stacks). */}\n <span class=\"m-0 text-[0.875rem] font-semibold tracking-tight text-ink-900 group-hover:underline dark:text-ink-100\">\n {s.name}\n </span>\n {typeof s.count === \"number\" && (\n <span class=\"inline-flex items-center rounded-md border border-ink-200 bg-ink-50 px-1.5 py-0.5 font-mono text-[10px] font-medium text-ink-600 dark:border-ink-800 dark:bg-ink-900/60 dark:text-ink-400\">\n {formatCount(s.count, itemNoun)}\n </span>\n )}\n </div>\n {s.blurb && <p class=\"m-0 truncate text-2xs text-ink-500 dark:text-ink-400\">{s.blurb}</p>}\n </div>\n {statusLabel(s.status) && (\n <span\n class:list={[\n \"shrink-0 inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wider\",\n s.status === \"live\"\n ? \"!bg-success/10 !text-success\"\n : s.status === \"expanding\"\n ? \"!bg-info/10 !text-info\"\n : \"!bg-warning/10 !text-warning\",\n ]}\n >\n {statusLabel(s.status)}\n </span>\n )}\n </a>\n ))}\n </div>\n </div>\n</section>\n",
183
+ "content": "---\nimport { formatCount, hrefForFilters } from '@grove-dev/core';\nimport Icon from './icon.astro';\n\n/**\n * StackGrid — browse-by-stack grid for the home page.\n *\n * Renders a card per stack with name, blurb, status pill\n * (live/expanding/planned), and a count. The href is the list\n * page filtered to that stack, so consumers compose the URL via\n * the `hrefFor` prop.\n *\n * Generic: no blueprint-specific terms. A \"stack\" here is just a\n * slug + display name + status; consumers derive both from their\n * own data.\n */\n\ninterface StackEntry {\n name: string;\n slug: string;\n blurb?: string;\n status?: 'live' | 'expanding' | 'planned';\n count?: number;\n}\n\ninterface Props {\n stacks: StackEntry[];\n /** List page base. */\n pathPrefix?: string;\n /** Stack icon registry — maps slug → icon file name. Optional. */\n iconAliases?: Record<string, string>;\n /** Extra class. */\n class?: string;\n /** Hide the section eyebrow / header entirely. */\n bare?: boolean;\n itemLabelPlural?: string;\n /** Noun pair for count chips — singular fixes \"1 projects\". */\n itemNoun?: { singular: string; plural: string };\n /** Pass 1 when this grid IS the page (`/stacks` index). */\n level?: 1 | 2;\n /**\n * Card link builder. Defaults to the browse page filtered by stack\n * (`{pathPrefix}?stack=…`); pass e.g. `(slug) => \\`/stacks/${slug}\\``\n * to link to taxonomy detail routes instead.\n */\n hrefFor?: (slug: string) => string;\n}\n\nconst {\n stacks,\n pathPrefix = '/',\n iconAliases,\n class: className = '',\n bare = false,\n itemLabelPlural = 'items',\n itemNoun = { singular: 'item', plural: 'items' },\n level = 2,\n hrefFor,\n} = Astro.props;\n\nconst Heading = `h${level}` as 'h1' | 'h2';\n\nfunction buildHref(slug: string): string {\n if (hrefFor) return hrefFor(slug);\n return hrefForFilters({ stacks: [slug] }, pathPrefix);\n}\n\nfunction statusLabel(s: StackEntry['status']): string | null {\n switch (s) {\n case 'live':\n return 'Available now';\n case 'expanding':\n return 'Expanding';\n case 'planned':\n return 'Planned';\n default:\n return null;\n }\n}\n---\n\n<section\n id=\"stacks\"\n class:list={[\"py-12 sm:py-16 scroll-mt-20 border-b border-ink-200 dark:border-ink-800\", className]}\n aria-labelledby={bare ? undefined : \"grove-stackgrid-heading\"}\n>\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n {!bare && (\n <header class=\"mb-6\">\n <span class=\"text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">\n Stacks\n </span>\n <Heading\n id=\"grove-stackgrid-heading\"\n class=\"m-0 mt-1 text-[1.5rem] sm:text-[1.625rem] font-semibold tracking-tight text-ink-900 dark:text-ink-100\"\n >\n Browse by stack\n </Heading>\n <p class=\"m-0 max-w-[60ch] text-[0.9375rem] text-ink-500 dark:text-ink-400\">\n Pick a stack to see real {itemLabelPlural} built with it.\n </p>\n </header>\n )}\n\n <div class=\"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3\">\n {stacks.map((s) => (\n <a\n href={buildHref(s.slug)}\n class=\"rounded-[calc(var(--radius)+0.25rem)] border border-border bg-card shadow-none transition-colors hover:border-ink-300 dark:hover:border-ink-700 group flex h-full items-center gap-3 p-3.5 no-underline\"\n data-event=\"stack_grid_click\"\n data-event-source=\"stack_grid\"\n >\n <div class=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-ink-200 bg-white dark:border-ink-800 dark:bg-ink-950\" aria-hidden=\"true\">\n <Icon name={iconAliases?.[s.slug] ?? s.slug} category=\"stack\" size={18} />\n </div>\n\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <div class=\"flex items-center gap-2\">\n {/* Not a heading: these tiles are links in a grid, and\n heading-per-card breaks the outline when the grid\n sits directly under the page h1 (/stacks). */}\n <span class=\"m-0 text-[0.875rem] font-semibold tracking-tight text-ink-900 group-hover:underline dark:text-ink-100\">\n {s.name}\n </span>\n {typeof s.count === \"number\" && (\n <span class=\"inline-flex items-center rounded-md border border-ink-200 bg-ink-50 px-1.5 py-0.5 font-mono text-[10px] font-medium text-ink-600 dark:border-ink-800 dark:bg-ink-900/60 dark:text-ink-400\">\n {formatCount(s.count, itemNoun)}\n </span>\n )}\n </div>\n {s.blurb && <p class=\"m-0 truncate text-2xs text-ink-500 dark:text-ink-400\">{s.blurb}</p>}\n </div>\n {statusLabel(s.status) && (\n <span\n class:list={[\n \"shrink-0 inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wider\",\n s.status === \"live\"\n ? \"!bg-success/10 !text-success\"\n : s.status === \"expanding\"\n ? \"!bg-info/10 !text-info\"\n : \"!bg-warning/10 !text-warning\",\n ]}\n >\n {statusLabel(s.status)}\n </span>\n )}\n </a>\n ))}\n </div>\n </div>\n</section>\n",
184
184
  "type": "registry:component",
185
185
  "target": "~/src/components/grove/stack-grid.astro"
186
186
  },
187
187
  {
188
188
  "path": "default/components/grove/category-grid.astro",
189
- "content": "---\nimport { formatCount } from '@grove-dev/core';\n\n/**\n * CategoryGrid — browse-by-category grid for the home page.\n *\n * The lighter sibling of StackGrid. Renders a card per category with\n * name, blurb, and count. Generic: takes a list of plain\n * `{ name, slug, blurb, count }` entries.\n */\n\ninterface CategoryEntry {\n name: string;\n slug: string;\n blurb?: string;\n count?: number;\n}\n\ninterface Props {\n categories: CategoryEntry[];\n /** List page base. */\n pathPrefix?: string;\n /** Extra class. */\n class?: string;\n /** Hide the section header. */\n bare?: boolean;\n itemLabelPlural?: string;\n /** Noun pair for count chips — singular fixes \"1 projects\". */\n itemNoun?: { singular: string; plural: string };\n /** Pass 1 when this grid IS the page (`/categories` index). */\n level?: 1 | 2;\n /** Card link builder (defaults to browse filtered by category). */\n hrefFor?: (slug: string) => string;\n}\n\nconst {\n categories,\n pathPrefix = '/',\n class: className = '',\n bare = false,\n itemLabelPlural = 'items',\n itemNoun = { singular: 'item', plural: 'items' },\n level = 2,\n hrefFor,\n} = Astro.props;\n\nconst Heading: 'h1' | 'h2' = level === 1 ? 'h1' : 'h2';\n\nfunction buildHref(slug: string): string {\n if (hrefFor) return hrefFor(slug);\n const base = pathPrefix.replace(/\\/$/, '');\n return `${base}?category=${encodeURIComponent(slug)}`;\n}\n---\n\n<section\n id=\"categories\"\n class:list={[\"py-12 sm:py-16 scroll-mt-20 border-b border-ink-200 dark:border-ink-800\", className]}\n aria-labelledby={bare ? undefined : \"grove-categorygrid-heading\"}\n>\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n {!bare && (\n <header class=\"mb-6\">\n <span class=\"text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">\n Categories\n </span>\n <Heading\n id=\"grove-categorygrid-heading\"\n class=\"m-0 mt-1 text-[1.5rem] sm:text-[1.625rem] font-semibold tracking-tight text-ink-900 dark:text-ink-100\"\n >\n Browse by category\n </Heading>\n <p class=\"m-0 max-w-[60ch] text-[0.9375rem] text-ink-500 dark:text-ink-400\">\n Find {itemLabelPlural} by what they do, not by which stack they use.\n </p>\n </header>\n )}\n\n <div class=\"overflow-hidden rounded-lg border border-ink-200 dark:border-ink-800\">\n <ul class=\"m-0 grid list-none grid-cols-1 divide-y divide-ink-200 p-0 sm:grid-cols-2 sm:divide-x sm:divide-y-0 lg:grid-cols-3 dark:divide-ink-800\">\n {categories.map((c) => (\n <li class=\"divide-x divide-ink-200 dark:divide-ink-800\">\n <a\n href={buildHref(c.slug)}\n class=\"group flex h-full items-start gap-3 p-4 no-underline transition-colors hover:bg-ink-50/60 dark:hover:bg-ink-900/40\"\n >\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <div class=\"flex items-center gap-2\">\n {/* Not a heading — see StackGrid: link tiles under a\n page h1 must not introduce h3 skips. */}\n <span class=\"m-0 text-[0.9375rem] font-semibold tracking-tight text-ink-900 group-hover:underline dark:text-ink-100\">\n {c.name}\n </span>\n {typeof c.count === \"number\" && (\n <span class=\"inline-flex items-center rounded-md border border-ink-200 bg-ink-50 px-1.5 py-0.5 font-mono text-[10px] font-medium text-ink-600 dark:border-ink-800 dark:bg-ink-900/60 dark:text-ink-400\">\n {formatCount(c.count, itemNoun)}\n </span>\n )}\n </div>\n {c.blurb && (\n <p class=\"m-0 text-2xs leading-relaxed text-ink-500 dark:text-ink-400\">\n {c.blurb}\n </p>\n )}\n </div>\n <svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" aria-hidden=\"true\" class=\"mt-1 shrink-0 text-ink-300 transition-colors group-hover:text-ink-500 dark:text-ink-700 dark:group-hover:text-ink-400\" fill=\"currentColor\">\n <path d=\"M6.22 3.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L9.94 8 6.22 4.28a.75.75 0 0 1 0-1.06Z\" />\n </svg>\n </a>\n </li>\n ))}\n </ul>\n </div>\n </div>\n</section>\n",
189
+ "content": "---\nimport { formatCount, hrefForFilters } from '@grove-dev/core';\n\n/**\n * CategoryGrid — browse-by-category grid for the home page.\n *\n * The lighter sibling of StackGrid. Renders a card per category with\n * name, blurb, and count. Generic: takes a list of plain\n * `{ name, slug, blurb, count }` entries.\n */\n\ninterface CategoryEntry {\n name: string;\n slug: string;\n blurb?: string;\n count?: number;\n}\n\ninterface Props {\n categories: CategoryEntry[];\n /** List page base. */\n pathPrefix?: string;\n /** Extra class. */\n class?: string;\n /** Hide the section header. */\n bare?: boolean;\n itemLabelPlural?: string;\n /** Noun pair for count chips — singular fixes \"1 projects\". */\n itemNoun?: { singular: string; plural: string };\n /** Pass 1 when this grid IS the page (`/categories` index). */\n level?: 1 | 2;\n /** Card link builder (defaults to browse filtered by category). */\n hrefFor?: (slug: string) => string;\n}\n\nconst {\n categories,\n pathPrefix = '/',\n class: className = '',\n bare = false,\n itemLabelPlural = 'items',\n itemNoun = { singular: 'item', plural: 'items' },\n level = 2,\n hrefFor,\n} = Astro.props;\n\nconst Heading: 'h1' | 'h2' = level === 1 ? 'h1' : 'h2';\n\nfunction buildHref(slug: string): string {\n if (hrefFor) return hrefFor(slug);\n return hrefForFilters({ categories: [slug] }, pathPrefix);\n}\n---\n\n<section\n id=\"categories\"\n class:list={[\"py-12 sm:py-16 scroll-mt-20 border-b border-ink-200 dark:border-ink-800\", className]}\n aria-labelledby={bare ? undefined : \"grove-categorygrid-heading\"}\n>\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n {!bare && (\n <header class=\"mb-6\">\n <span class=\"text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">\n Categories\n </span>\n <Heading\n id=\"grove-categorygrid-heading\"\n class=\"m-0 mt-1 text-[1.5rem] sm:text-[1.625rem] font-semibold tracking-tight text-ink-900 dark:text-ink-100\"\n >\n Browse by category\n </Heading>\n <p class=\"m-0 max-w-[60ch] text-[0.9375rem] text-ink-500 dark:text-ink-400\">\n Find {itemLabelPlural} by what they do, not by which stack they use.\n </p>\n </header>\n )}\n\n <div class=\"overflow-hidden rounded-lg border border-ink-200 dark:border-ink-800\">\n <ul class=\"m-0 grid list-none grid-cols-1 divide-y divide-ink-200 p-0 sm:grid-cols-2 sm:divide-x sm:divide-y-0 lg:grid-cols-3 dark:divide-ink-800\">\n {categories.map((c) => (\n <li class=\"divide-x divide-ink-200 dark:divide-ink-800\">\n <a\n href={buildHref(c.slug)}\n class=\"group flex h-full items-start gap-3 p-4 no-underline transition-colors hover:bg-ink-50/60 dark:hover:bg-ink-900/40\"\n >\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <div class=\"flex items-center gap-2\">\n {/* Not a heading — see StackGrid: link tiles under a\n page h1 must not introduce h3 skips. */}\n <span class=\"m-0 text-[0.9375rem] font-semibold tracking-tight text-ink-900 group-hover:underline dark:text-ink-100\">\n {c.name}\n </span>\n {typeof c.count === \"number\" && (\n <span class=\"inline-flex items-center rounded-md border border-ink-200 bg-ink-50 px-1.5 py-0.5 font-mono text-[10px] font-medium text-ink-600 dark:border-ink-800 dark:bg-ink-900/60 dark:text-ink-400\">\n {formatCount(c.count, itemNoun)}\n </span>\n )}\n </div>\n {c.blurb && (\n <p class=\"m-0 text-2xs leading-relaxed text-ink-500 dark:text-ink-400\">\n {c.blurb}\n </p>\n )}\n </div>\n <svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" aria-hidden=\"true\" class=\"mt-1 shrink-0 text-ink-300 transition-colors group-hover:text-ink-500 dark:text-ink-700 dark:group-hover:text-ink-400\" fill=\"currentColor\">\n <path d=\"M6.22 3.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L9.94 8 6.22 4.28a.75.75 0 0 1 0-1.06Z\" />\n </svg>\n </a>\n </li>\n ))}\n </ul>\n </div>\n </div>\n</section>\n",
190
190
  "type": "registry:component",
191
191
  "target": "~/src/components/grove/category-grid.astro"
192
192
  },
@@ -264,7 +264,7 @@
264
264
  },
265
265
  {
266
266
  "path": "default/pages/index.astro",
267
- "content": "---\nimport records from '@grove/generated/records.json';\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getCollectionTeaserModel,\n getHomePageModel,\n loadCollections,\n recordsToCollectionEntries,\n} from '@grove-dev/astro/server';\nimport CategoryGrid from '../components/grove/category-grid.astro';\nimport CollectionTeaser from '../components/grove/collection-teaser.astro';\nimport ContributorsGrid from '../components/grove/contributors-grid.astro';\nimport FinalCta from '../components/grove/final-cta.astro';\nimport Hero from '../components/grove/hero.astro';\nimport HeroProof from '../components/grove/hero-proof.astro';\nimport OriginalCollection from '../components/grove/original-collection.astro';\nimport PipelineStrip from '../components/grove/pipeline-strip.astro';\nimport RecordSection from '../components/grove/record-section.astro';\nimport StackGrid from '../components/grove/stack-grid.astro';\nimport WhyThisExists from '../components/grove/why-this-exists.astro';\n/**\n * Home page — generic.\n *\n * Mirrors the openapps structure: Hero → WhyThisExists → three\n * lens sections (hot / new / mature) → StackGrid → CategoryGrid →\n * ContributorsGrid → OriginalCollection.\n *\n * All data derives from `data/generated/records.{index,full}.json`\n * and `data/generated/site-config.json`. Nothing here is hardcoded\n * to a specific blueprint — section copy uses singular/plural\n * labels from `itemLabel()`/`itemLabelPlural()`.\n */\nimport BaseLayout from '../layouts/base-layout.astro';\n\nconst home = getHomePageModel(siteConfig);\nconst { slug, itemSingular, itemPlural } = home;\n\n// ── Lens sectioning (Hot / New / Mature) ────────────────────────\nconst hotList = home.hot;\nconst newList = home.recentlyAdded;\nconst matureList = home.established;\n\nconst { stacks, categories } = home;\n\nconst { contributors, stats, title, description } = home;\n\n// ── Featured collections teaser ─────────────────────────────────\nconst allCollections = await loadCollections(process.cwd());\nconst teaserEntries = recordsToCollectionEntries(\n (records as { records: unknown[] }).records as never,\n siteConfig,\n);\nconst collectionTeaser = getCollectionTeaserModel(allCollections, teaserEntries, 3);\n---\n\n<BaseLayout title={title} description={description} image={home.seo.image} site={siteConfig}>\n <Hero\n name={`Find ${itemPlural} you can actually`}\n tagline=\"run, study, and contribute to.\"\n description={`Every listing is a YAML file in a public repository — Grove publishes those files as this site, a README, and machine-readable outputs, and keeps them in sync.`}\n eyebrow=\"Curated in plain files, published by Grove\"\n stats={{\n totalApps: stats.apps,\n totalCategories: stats.categories,\n totalStacks: stats.stacks,\n totalOwners: stats.owners,\n totalStars: stats.stars,\n }}\n itemsLabel={itemPlural}\n searchHref={`/${slug}`}\n searchPlaceholder={`Search ${itemPlural}, stacks, or categories...`}\n quickFilters={[\n { label: `Trending ${itemPlural}`, href: `/${slug}?label=hot` },\n { label: \"Recently added\", href: `/${slug}?sort=recently-added` },\n { label: \"How this site works\", href: \"#pipeline\" },\n ]}\n ctas={[\n { label: `Browse ${itemPlural}`, href: `/${slug}/`, variant: \"primary\" },\n ]}\n >\n {((siteConfig as { press?: unknown[] }).press?.length ?? 0) > 0 && (\n <HeroProof slot=\"eyebrow\" variant=\"pill\" />\n )}\n <HeroProof slot=\"proof\" variant=\"row\" contributors={contributors} />\n </Hero>\n\n <WhyThisExists />\n\n <PipelineStrip repoUrl={siteConfig.repoUrl} />\n\n <RecordSection\n id=\"hot\"\n title=\"Trending now\"\n description={`${itemPlural.charAt(0).toUpperCase() + itemPlural.slice(1)} gaining stars, activity, or attention recently.`}\n eyebrow=\"Hot\"\n items={hotList}\n hrefFor={(r) => `/${slug}/${r.slug}/`}\n viewAllHref={`/${slug}?label=hot`}\n viewAllLabel={`View all trending ${itemPlural}`}\n />\n\n <RecordSection\n id=\"new\"\n title=\"Recently added\"\n description={`${itemPlural.charAt(0).toUpperCase() + itemPlural.slice(1)} added to the directory in the last few weeks.`}\n eyebrow=\"New\"\n items={newList}\n hrefFor={(r) => `/${slug}/${r.slug}/`}\n viewAllHref={`/${slug}?sort=recently-added`}\n viewAllLabel={`View all recently added`}\n />\n\n <RecordSection\n id=\"mature\"\n title=\"Established\"\n description={`Long-running curated ${itemPlural} with strong history, active maintainers, and real-world usage.`}\n eyebrow=\"Mature\"\n items={matureList}\n hrefFor={(r) => `/${slug}/${r.slug}/`}\n viewAllHref={`/${slug}?label=mature`}\n viewAllLabel={`View all established`}\n />\n\n <StackGrid\n stacks={stacks}\n pathPrefix={`/${slug}`}\n itemLabelPlural={itemPlural}\n itemNoun={{ singular: itemSingular, plural: itemPlural }}\n hrefFor={(stackSlug: string) => `/stacks/${stackSlug}/`}\n />\n <CollectionTeaser\n model={collectionTeaser}\n countNoun={{ singular: itemSingular, plural: itemPlural }}\n />\n <CategoryGrid\n categories={categories}\n pathPrefix={`/${slug}`}\n itemLabelPlural={itemPlural}\n itemNoun={{ singular: itemSingular, plural: itemPlural }}\n hrefFor={(categorySlug: string) => `/categories/${categorySlug}/`}\n />\n\n <ContributorsGrid\n contributors={contributors}\n total={contributors.length || undefined}\n viewAllHref={`/contributors`}\n viewAllLabel=\"Meet the community\"\n showContributionCount={siteConfig.contributors?.showContributionCount ?? true}\n />\n\n {siteConfig.stats?.originalRepo && (\n <OriginalCollection\n repoUrl={siteConfig.stats.originalRepo}\n stats={{\n stars: siteConfig.stats.originalStars,\n forks: siteConfig.stats.originalForks,\n contributors: siteConfig.stats.originalContributors,\n }}\n />\n )}\n\n <FinalCta\n itemLabel={itemSingular}\n itemsLabel={itemPlural}\n browseHref={`/${slug}`}\n />\n</BaseLayout>\n",
267
+ "content": "---\nimport records from '@grove/generated/records.json';\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getCollectionTeaserModel,\n getHomePageModel,\n loadCollections,\n recordsToCollectionEntries,\n} from '@grove-dev/astro/server';\nimport CategoryGrid from '../components/grove/category-grid.astro';\nimport CollectionTeaser from '../components/grove/collection-teaser.astro';\nimport ContributorsGrid from '../components/grove/contributors-grid.astro';\nimport FinalCta from '../components/grove/final-cta.astro';\nimport Hero from '../components/grove/hero.astro';\nimport HeroProof from '../components/grove/hero-proof.astro';\nimport OriginalCollection from '../components/grove/original-collection.astro';\nimport PipelineStrip from '../components/grove/pipeline-strip.astro';\nimport RecordSection from '../components/grove/record-section.astro';\nimport StackGrid from '../components/grove/stack-grid.astro';\nimport WhyThisExists from '../components/grove/why-this-exists.astro';\n/**\n * Home page — generic.\n *\n * Mirrors the openapps structure: Hero → WhyThisExists → three\n * lens sections (hot / new / mature) → StackGrid → CategoryGrid →\n * ContributorsGrid → OriginalCollection.\n *\n * All data derives from `data/generated/records.{index,full}.json`\n * and `data/generated/site-config.json`. Nothing here is hardcoded\n * to a specific blueprint — section copy uses singular/plural\n * labels from `itemLabel()`/`itemLabelPlural()`.\n */\nimport BaseLayout from '../layouts/base-layout.astro';\n\nconst home = getHomePageModel(siteConfig);\nconst { slug, itemSingular, itemPlural } = home;\n\n// ── Lens sectioning (Hot / New / Mature) ────────────────────────\nconst hotList = home.hot;\nconst newList = home.recentlyAdded;\nconst matureList = home.established;\n\nconst { stacks, categories } = home;\n\nconst { contributors, stats, title, description } = home;\n\n// ── Featured collections teaser ─────────────────────────────────\nconst allCollections = await loadCollections(process.cwd());\nconst teaserEntries = recordsToCollectionEntries(\n (records as { records: unknown[] }).records as never,\n siteConfig,\n);\nconst collectionTeaser = getCollectionTeaserModel(allCollections, teaserEntries, 3);\n---\n\n<BaseLayout title={title} description={description} image={home.seo.image} site={siteConfig}>\n <Hero\n name={`Find ${itemPlural} you can actually`}\n tagline=\"run, study, and contribute to.\"\n description={`Every listing is a YAML file in a public repository — Grove publishes those files as this site, a README, and machine-readable outputs, and keeps them in sync.`}\n eyebrow=\"Curated in plain files, published by Grove\"\n stats={{\n totalApps: stats.apps,\n totalCategories: stats.categories,\n totalStacks: stats.stacks,\n totalOwners: stats.owners,\n totalStars: stats.stars,\n }}\n itemsLabel={itemPlural}\n searchHref={`/${slug}/`}\n searchPlaceholder={`Search ${itemPlural}, stacks, or categories...`}\n quickFilters={[\n { label: `Trending ${itemPlural}`, href: `/${slug}/?label=hot` },\n { label: \"Recently added\", href: `/${slug}/?sort=recently-added` },\n { label: \"How this site works\", href: \"#pipeline\" },\n ]}\n ctas={[\n { label: `Browse ${itemPlural}`, href: `/${slug}/`, variant: \"primary\" },\n ]}\n >\n {((siteConfig as { press?: unknown[] }).press?.length ?? 0) > 0 && (\n <HeroProof slot=\"eyebrow\" variant=\"pill\" />\n )}\n <HeroProof slot=\"proof\" variant=\"row\" contributors={contributors} />\n </Hero>\n\n <WhyThisExists />\n\n <PipelineStrip repoUrl={siteConfig.repoUrl} />\n\n <RecordSection\n id=\"hot\"\n title=\"Trending now\"\n description={`${itemPlural.charAt(0).toUpperCase() + itemPlural.slice(1)} gaining stars, activity, or attention recently.`}\n eyebrow=\"Hot\"\n items={hotList}\n hrefFor={(r) => `/${slug}/${r.slug}/`}\n viewAllHref={`/${slug}/?label=hot`}\n viewAllLabel={`View all trending ${itemPlural}`}\n />\n\n <RecordSection\n id=\"new\"\n title=\"Recently added\"\n description={`${itemPlural.charAt(0).toUpperCase() + itemPlural.slice(1)} added to the directory in the last few weeks.`}\n eyebrow=\"New\"\n items={newList}\n hrefFor={(r) => `/${slug}/${r.slug}/`}\n viewAllHref={`/${slug}/?sort=recently-added`}\n viewAllLabel={`View all recently added`}\n />\n\n <RecordSection\n id=\"mature\"\n title=\"Established\"\n description={`Long-running curated ${itemPlural} with strong history, active maintainers, and real-world usage.`}\n eyebrow=\"Mature\"\n items={matureList}\n hrefFor={(r) => `/${slug}/${r.slug}/`}\n viewAllHref={`/${slug}/?label=mature`}\n viewAllLabel={`View all established`}\n />\n\n <StackGrid\n stacks={stacks}\n pathPrefix={`/${slug}`}\n itemLabelPlural={itemPlural}\n itemNoun={{ singular: itemSingular, plural: itemPlural }}\n hrefFor={(stackSlug: string) => `/stacks/${stackSlug}/`}\n />\n <CollectionTeaser\n model={collectionTeaser}\n countNoun={{ singular: itemSingular, plural: itemPlural }}\n />\n <CategoryGrid\n categories={categories}\n pathPrefix={`/${slug}`}\n itemLabelPlural={itemPlural}\n itemNoun={{ singular: itemSingular, plural: itemPlural }}\n hrefFor={(categorySlug: string) => `/categories/${categorySlug}/`}\n />\n\n <ContributorsGrid\n contributors={contributors}\n total={contributors.length || undefined}\n viewAllHref={`/contributors/`}\n viewAllLabel=\"Meet the community\"\n showContributionCount={siteConfig.contributors?.showContributionCount ?? true}\n />\n\n {siteConfig.stats?.originalRepo && (\n <OriginalCollection\n repoUrl={siteConfig.stats.originalRepo}\n stats={{\n stars: siteConfig.stats.originalStars,\n forks: siteConfig.stats.originalForks,\n contributors: siteConfig.stats.originalContributors,\n }}\n />\n )}\n\n <FinalCta\n itemLabel={itemSingular}\n itemsLabel={itemPlural}\n browseHref={`/${slug}/`}\n />\n</BaseLayout>\n",
268
268
  "type": "registry:page",
269
269
  "target": "~/src/pages/index.astro"
270
270
  },
@@ -306,7 +306,7 @@
306
306
  },
307
307
  {
308
308
  "path": "default/components/grove/final-cta.astro",
309
- "content": "---\nimport { buttonClass } from '../../lib/classnames.ts';\n\ninterface Props {\n itemLabel?: string;\n itemsLabel?: string;\n browseHref?: string;\n submitHref?: string;\n class?: string;\n}\n\nconst {\n itemLabel = 'item',\n itemsLabel = 'items',\n browseHref = '/items',\n submitHref = '/submit',\n class: className = '',\n} = Astro.props;\n---\n\n<section class:list={[\"border-t border-ink-200 py-10 sm:py-12 dark:border-ink-800\", className]} aria-labelledby=\"grove-final-cta-heading\">\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n <div class=\"rounded-[calc(var(--radius)+0.25rem)] border border-border bg-card px-6 py-7 sm:flex sm:items-center sm:justify-between sm:gap-10 sm:px-8 sm:py-8 dark:border-ink-800\">\n <div class=\"max-w-2xl\">\n <p class=\"m-0 text-2xs font-semibold uppercase tracking-wider text-ink-500 dark:text-ink-400\">Keep the directory useful</p>\n <h2 id=\"grove-final-cta-heading\" class=\"m-0 mt-1.5 text-[1.5rem] font-semibold tracking-tight text-ink-900 sm:text-[1.75rem] dark:text-ink-100\">\n Know {itemLabel === \"app\" ? \"an\" : \"a\"} {itemLabel} that belongs here?\n </h2>\n <p class=\"m-0 mt-2 max-w-xl text-sm leading-relaxed text-ink-500 dark:text-ink-400\">\n Add a real, inspectable project or improve the metadata behind an existing listing.\n </p>\n </div>\n <div class=\"mt-5 flex shrink-0 flex-wrap items-center gap-2 sm:mt-0 sm:justify-end\">\n <a href={submitHref} class={buttonClass(\"primary\", \"md\", \"px-4\")}>\n Submit {itemLabel}\n </a>\n <a href={browseHref} class={buttonClass(\"outline\", \"md\", \"px-4\")}>\n Explore {itemsLabel}\n </a>\n </div>\n </div>\n </div>\n</section>\n",
309
+ "content": "---\nimport { buttonClass } from '../../lib/classnames.ts';\n\ninterface Props {\n itemLabel?: string;\n itemsLabel?: string;\n browseHref?: string;\n submitHref?: string;\n class?: string;\n}\n\nconst {\n itemLabel = 'item',\n itemsLabel = 'items',\n browseHref = '/items/',\n submitHref = '/submit/',\n class: className = '',\n} = Astro.props;\n---\n\n<section class:list={[\"border-t border-ink-200 py-10 sm:py-12 dark:border-ink-800\", className]} aria-labelledby=\"grove-final-cta-heading\">\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n <div class=\"rounded-[calc(var(--radius)+0.25rem)] border border-border bg-card px-6 py-7 sm:flex sm:items-center sm:justify-between sm:gap-10 sm:px-8 sm:py-8 dark:border-ink-800\">\n <div class=\"max-w-2xl\">\n <p class=\"m-0 text-2xs font-semibold uppercase tracking-wider text-ink-500 dark:text-ink-400\">Keep the directory useful</p>\n <h2 id=\"grove-final-cta-heading\" class=\"m-0 mt-1.5 text-[1.5rem] font-semibold tracking-tight text-ink-900 sm:text-[1.75rem] dark:text-ink-100\">\n Know {itemLabel === \"app\" ? \"an\" : \"a\"} {itemLabel} that belongs here?\n </h2>\n <p class=\"m-0 mt-2 max-w-xl text-sm leading-relaxed text-ink-500 dark:text-ink-400\">\n Add a real, inspectable project or improve the metadata behind an existing listing.\n </p>\n </div>\n <div class=\"mt-5 flex shrink-0 flex-wrap items-center gap-2 sm:mt-0 sm:justify-end\">\n <a href={submitHref} class={buttonClass(\"primary\", \"md\", \"px-4\")}>\n Submit {itemLabel}\n </a>\n <a href={browseHref} class={buttonClass(\"outline\", \"md\", \"px-4\")}>\n Explore {itemsLabel}\n </a>\n </div>\n </div>\n </div>\n</section>\n",
310
310
  "type": "registry:component",
311
311
  "target": "~/src/components/grove/final-cta.astro"
312
312
  },
@@ -342,13 +342,13 @@
342
342
  },
343
343
  {
344
344
  "path": "default/components/grove/directory-browse.astro",
345
- "content": "---\n/**\n * DirectoryBrowse — the browse page body, shared by the two routes\n * that render it: `/{slug}/` (page 1) and `/{slug}/page/{n}/`.\n *\n * Layout, top to bottom:\n * - PageHeader (the only place the page names itself) and lens tabs\n * - `DirectoryBrowseView`: search + sort, facet filters, applied\n * chips, the result count line, the card grid and pagination\n * - The submit call to action\n *\n * Navigation model: **pages are real paths.** Each route prerenders\n * only its own 20 records, so an unfiltered directory of any size is\n * crawlable, works without JavaScript, and never ships the whole\n * catalogue as DOM.\n *\n * Filtering stays client-side: these routes are PRERENDERED, so at\n * build time `Astro.url.searchParams` is empty. `DirectoryIndexClient`\n * (rendered by `DirectoryBrowseView`) re-reads `location.search` and\n * re-derives the result list, chips, pagination, and facet\n * intersection counts with the same `@grove-dev/core/directory`\n * functions the server used. Filtered views paginate with `?page=N` on\n * the base route. Taxonomy pages render the same view with a `scope`.\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getDirectoryIndexModel,\n itemLabel,\n itemLabelPlural,\n seoTitle,\n titleCaseFirst,\n} from '@grove-dev/astro/server';\nimport { formatCount } from '@grove-dev/core';\nimport BaseLayout from '../../layouts/base-layout.astro';\nimport Button from '../ui/button.astro';\nimport PageHeader from '../ui/page-header.astro';\nimport DirectoryBrowseView from './directory-browse-view.astro';\nimport SmartLensTabs from './smart-lens-tabs.astro';\n\ninterface Props {\n /** 1-based page this route renders. */\n routePage?: number;\n}\n\nconst { routePage = 1 } = Astro.props;\nconst slug = siteConfig.blueprintConfig?.routeSlug ?? 'projects';\nconst { total, page, seo } = getDirectoryIndexModel(Astro.url.searchParams, siteConfig, {\n page: routePage,\n});\n\n// Page 2+ gets a distinct title and skips the ItemList JSON-LD so the\n// list markup isn't duplicated across every paginated route. The\n// per-page description is built inside `getDirectoryIndexModel` so it\n// fits inside the 160-char cap; this view just forwards `seo.title`.\nconst title =\n page > 1\n ? seoTitle(`Browse ${titleCaseFirst(itemLabelPlural())} — Page ${page}`, siteConfig.name)\n : seo.title;\nconst description = seo.description;\n---\n\n<BaseLayout\n title={title}\n description={description}\n image={seo.image}\n jsonLd={page > 1 ? undefined : seo.jsonLd}\n site={siteConfig}\n submitHref=\"/submit\"\n submitLabel={`Submit ${itemLabel()}`}\n>\n <DirectoryBrowseView routePage={routePage}>\n <Fragment slot=\"header\">\n <PageHeader\n eyebrow={slug}\n title={`Browse ${slug}`}\n description={`Search, filter, and explore ${formatCount(total, { singular: itemLabel(), plural: itemLabelPlural() })} in this directory.`}\n />\n\n {/* Curated views. Real links (not a JS-driven control) — the\n same server-and-client filter pipeline (@grove-dev/core's\n filtersFromSearchParams/filterRecords) already understands\n `?lens=`, so this works with JS disabled too. */}\n <SmartLensTabs\n currentParams={Astro.url.searchParams}\n pathPrefix={`/${slug}`}\n lensIds={[\"all\", \"hot\", \"new\", \"mature\"]}\n allLabel={`All ${itemLabelPlural()}`}\n class=\"mt-6\"\n />\n </Fragment>\n </DirectoryBrowseView>\n\n <section class=\"border-t border-ink-200 dark:border-ink-800\">\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n <div class=\"flex flex-col items-center gap-3 py-12 text-center\">\n <h2 class=\"m-0 text-xl font-semibold tracking-tight text-ink-900 dark:text-ink-100\">\n {`Know a real ${itemLabel()} that belongs here?`}\n </h2>\n <p class=\"m-0 max-w-2xl text-sm text-ink-500 dark:text-ink-400\">\n {`Open a pull request with a YAML file. We review every submission against the bar — no marketing, no tutorials.`}\n </p>\n <Button href=\"/submit\" variant=\"primary\" size=\"sm\" class=\"mt-2\">\n {`Submit ${itemLabel()}`}\n </Button>\n\n </div>\n </div>\n </section>\n</BaseLayout>\n",
345
+ "content": "---\n/**\n * DirectoryBrowse — the browse page body, shared by the two routes\n * that render it: `/{slug}/` (page 1) and `/{slug}/page/{n}/`.\n *\n * Layout, top to bottom:\n * - PageHeader (the only place the page names itself) and lens tabs\n * - `DirectoryBrowseView`: search + sort, facet filters, applied\n * chips, the result count line, the card grid and pagination\n * - The submit call to action\n *\n * Navigation model: **pages are real paths.** Each route prerenders\n * only its own 20 records, so an unfiltered directory of any size is\n * crawlable, works without JavaScript, and never ships the whole\n * catalogue as DOM.\n *\n * Filtering stays client-side: these routes are PRERENDERED, so at\n * build time `Astro.url.searchParams` is empty. `DirectoryIndexClient`\n * (rendered by `DirectoryBrowseView`) re-reads `location.search` and\n * re-derives the result list, chips, pagination, and facet\n * intersection counts with the same `@grove-dev/core/directory`\n * functions the server used. Filtered views paginate with `?page=N` on\n * the base route. Taxonomy pages render the same view with a `scope`.\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getDirectoryIndexModel,\n itemLabel,\n itemLabelPlural,\n seoTitle,\n titleCaseFirst,\n} from '@grove-dev/astro/server';\nimport { formatCount } from '@grove-dev/core';\nimport BaseLayout from '../../layouts/base-layout.astro';\nimport Button from '../ui/button.astro';\nimport PageHeader from '../ui/page-header.astro';\nimport DirectoryBrowseView from './directory-browse-view.astro';\nimport SmartLensTabs from './smart-lens-tabs.astro';\n\ninterface Props {\n /** 1-based page this route renders. */\n routePage?: number;\n}\n\nconst { routePage = 1 } = Astro.props;\nconst slug = siteConfig.blueprintConfig?.routeSlug ?? 'projects';\nconst { total, page, seo } = getDirectoryIndexModel(Astro.url.searchParams, siteConfig, {\n page: routePage,\n});\n\n// Page 2+ gets a distinct title and skips the ItemList JSON-LD so the\n// list markup isn't duplicated across every paginated route. The\n// per-page description is built inside `getDirectoryIndexModel` so it\n// fits inside the 160-char cap; this view just forwards `seo.title`.\nconst title =\n page > 1\n ? seoTitle(`Browse ${titleCaseFirst(itemLabelPlural())} — Page ${page}`, siteConfig.name)\n : seo.title;\nconst description = seo.description;\n---\n\n<BaseLayout\n title={title}\n description={description}\n image={seo.image}\n jsonLd={page > 1 ? undefined : seo.jsonLd}\n site={siteConfig}\n submitHref=\"/submit/\"\n submitLabel={`Submit ${itemLabel()}`}\n>\n <DirectoryBrowseView routePage={routePage}>\n <Fragment slot=\"header\">\n <PageHeader\n eyebrow={slug}\n title={`Browse ${slug}`}\n description={`Search, filter, and explore ${formatCount(total, { singular: itemLabel(), plural: itemLabelPlural() })} in this directory.`}\n />\n\n {/* Curated views. Real links (not a JS-driven control) — the\n same server-and-client filter pipeline (@grove-dev/core's\n filtersFromSearchParams/filterRecords) already understands\n `?lens=`, so this works with JS disabled too. */}\n <SmartLensTabs\n currentParams={Astro.url.searchParams}\n pathPrefix={`/${slug}`}\n lensIds={[\"all\", \"hot\", \"new\", \"mature\"]}\n allLabel={`All ${itemLabelPlural()}`}\n class=\"mt-6\"\n />\n </Fragment>\n </DirectoryBrowseView>\n\n <section class=\"border-t border-ink-200 dark:border-ink-800\">\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n <div class=\"flex flex-col items-center gap-3 py-12 text-center\">\n <h2 class=\"m-0 text-xl font-semibold tracking-tight text-ink-900 dark:text-ink-100\">\n {`Know a real ${itemLabel()} that belongs here?`}\n </h2>\n <p class=\"m-0 max-w-2xl text-sm text-ink-500 dark:text-ink-400\">\n {`Open a pull request with a YAML file. We review every submission against the bar — no marketing, no tutorials.`}\n </p>\n <Button href=\"/submit/\" variant=\"primary\" size=\"sm\" class=\"mt-2\">\n {`Submit ${itemLabel()}`}\n </Button>\n\n </div>\n </div>\n </section>\n</BaseLayout>\n",
346
346
  "type": "registry:component",
347
347
  "target": "~/src/components/grove/directory-browse.astro"
348
348
  },
349
349
  {
350
350
  "path": "default/components/grove/directory-browse-view.astro",
351
- "content": "---\n/**\n * DirectoryBrowseView — the browse engine's body: search and sort, the\n * facet filters, the applied-filter chips, the results, and the client\n * controller that keeps all of it in step with the query string.\n *\n * Two kinds of page render it:\n * - `DirectoryBrowse` (`/{slug}/`, `/{slug}/page/{n}/`), which puts\n * its page header and lens tabs in the `header` slot.\n * - `TaxonomyList` (`/stacks/<id>/`, `/categories/<id>/`, …), which\n * passes a `scope` and its own `pathPrefix`.\n *\n * `scope` is an immutable slice of the directory, such as\n * `{ stacks: ['flutter'] }`. It is merged into every query, so results\n * and facet counts only ever come from the scoped set. It is never a\n * chip, its facet group is not rendered, and it never goes in the URL:\n * the page's own path already says it. Filters, sort and the query\n * live in that page's query string (`/stacks/flutter/?platform=ios`),\n * and \"Clear all\" or the zero-results reset lead back to the page\n * itself, so nothing can drop the scope.\n *\n * A scoped list is not paginated. The host page has no `/page/{n}/`\n * routes, so one prerendered document carries every record in the\n * scope, which keeps all of them linked without JavaScript. That is\n * what taxonomy pages rendered before they had filters.\n *\n * With no `scope` this renders exactly what `/{slug}/` always did.\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport { SORT_OPTIONS, sortDisplay } from '@grove-dev/astro';\nimport {\n getDirectoryIndexModel,\n itemLabel,\n itemLabelPlural,\n taxonomy,\n} from '@grove-dev/astro/server';\nimport { searchParamsFromFilters } from '@grove-dev/core';\nimport { chipClass } from '../../lib/classnames.ts';\nimport { type DirectoryScope, scopedGroups } from '../../lib/live-filters.ts';\nimport Button from '../ui/button.astro';\nimport FilterDrawer from '../ui/filter-drawer.astro';\nimport SearchField from '../ui/search-field.astro';\nimport CardGrid from './card-grid.astro';\nimport DirectoryIndexClient from './directory-index-client.astro';\nimport IndexRow from './index-row.astro';\nimport Pagination from './pagination.astro';\nimport RefinePanel from './refine-panel.astro';\n\ninterface Props {\n /** 1-based page this route renders. Ignored when `scope` is set. */\n routePage?: number;\n /**\n * Fixed filters for every query on this page, e.g.\n * `{ categories: ['productivity'] }`. Omit on the directory itself.\n */\n scope?: DirectoryScope;\n /**\n * Path the filtered URLs are built on, without a trailing slash.\n * Default: the directory route (`/{slug}`). A scoped page passes its\n * own path (`/stacks/flutter`).\n */\n pathPrefix?: string;\n}\n\nconst slug = siteConfig.blueprintConfig?.routeSlug ?? 'projects';\nconst { routePage = 1, scope, pathPrefix = `/${slug}` } = Astro.props;\nconst fixed = scopedGroups(scope);\nconst scoped = fixed.length > 0;\n\n// A scoped page asks the same model the directory uses, with the scope\n// as its query. Every facet's intersection count then already excludes\n// records outside the scope, and `sorted` is the scoped set. On an\n// unscoped page the build never sees a query, so this is empty.\nconst query = scoped\n ? searchParamsFromFilters(\n Object.fromEntries(fixed.map((group) => [group, [...(scope?.[group] ?? [])]])),\n )\n : Astro.url.searchParams;\nconst model = getDirectoryIndexModel(query, siteConfig, { page: scoped ? 1 : routePage });\nconst { filters, searchPlaceholder, sort, sorted } = model;\n\n// The scoped group is the page itself, not a choice: no facet for it,\n// and no chip. Nothing else the visitor picked exists at build time.\nconst facetGroups = model.facetGroups.filter(\n (group) => !fixed.includes(group.filterKey as (typeof fixed)[number]),\n);\nconst chips = scoped ? [] : model.chips;\nconst clearFiltersHref = scoped ? `${pathPrefix}/` : model.clearFiltersHref;\nconst pageItems = scoped ? sorted : model.pageItems;\nconst pages = scoped ? 1 : model.pages;\nconst page = scoped ? 1 : model.page;\nconst { hrefForResultPage } = model;\n---\n\n<section class=\"border-b border-border bg-background\">\n <div class:list={[\"mx-auto w-full max-w-container px-5 sm:px-7\", Astro.slots.has(\"header\") && \"pt-10 sm:pt-12\"]}>\n <slot name=\"header\" />\n\n {/* Row 1 — search and sort. Search filters as you type (see\n DirectoryIndexClient); the submit button is sr-only so Enter\n still works when JavaScript never arrives. */}\n <form\n method=\"get\"\n action={pathPrefix}\n id=\"search-form\"\n class:list={[\"flex flex-col gap-2 sm:flex-row\", Astro.slots.has(\"header\") && \"mt-6\"]}\n role=\"search\"\n >\n <SearchField\n class=\"flex-1\"\n label={`Search ${itemLabelPlural()}`}\n value={filters.q ?? \"\"}\n placeholder={searchPlaceholder}\n shortcut\n />\n <label class=\"relative\">\n <span class=\"sr-only\">{`Sort ${itemLabelPlural()}`}</span>\n <select\n id=\"sort-select\"\n name=\"sort\"\n class=\"h-10 w-full cursor-pointer appearance-none rounded-md border border-input bg-background py-1.5 pl-3 pr-8 text-sm font-medium text-foreground transition-colors hover:border-ring focus:border-ring focus:outline-none focus:ring-2 focus:ring-ring/20 sm:w-auto\"\n >\n {SORT_OPTIONS.map((o) => (\n <option value={o.value} selected={o.value === sort}>{o.label}</option>\n ))}\n </select>\n <svg\n viewBox=\"0 0 16 16\"\n width=\"11\"\n height=\"11\"\n aria-hidden=\"true\"\n class=\"pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground\"\n fill=\"currentColor\"\n >\n <path d=\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\" />\n </svg>\n </label>\n <button type=\"submit\" class=\"sr-only\">Search</button>\n </form>\n\n {/* Row 2 — every filter on one line. On mobile they collapse into\n a full-width \"Filters (n)\" button opening a bottom sheet.\n Filters apply live in both places. The sheet's footer button\n (\"Show 12 apps\") just closes it and moves focus to the\n results heading. */}\n <div class=\"mt-3\">\n <FilterDrawer\n label=\"Filters\"\n activeCount={chips.length}\n clearHref={clearFiltersHref}\n resultsLabel={`Show ${sorted.length} ${sorted.length === 1 ? itemLabel() : itemLabelPlural()}`}\n resultsTarget=\"#results-heading\"\n >\n {/* The applied chips again, inside the sheet: on mobile the\n row above the list is behind the sheet. On desktop the\n filters render inline right above that row, so this copy\n stays hidden. DirectoryIndexClient fills both. The sheet's\n header already has \"Clear all\", so this row leaves it out. */}\n <div\n data-active-filters\n data-without-clear\n class:list={[\"mb-3 flex flex-wrap items-center gap-1.5 md:hidden\", chips.length === 0 && \"hidden\"]}\n aria-label=\"Active filters\"\n ></div>\n <RefinePanel\n class=\"max-md:flex-col max-md:items-stretch\"\n groups={facetGroups}\n initial={filters}\n pathPrefix={pathPrefix}\n hide={[\"sort\"]}\n />\n </FilterDrawer>\n </div>\n\n {/* Row 3 — what is currently narrowing the list, and one way out\n of all of it. Server-rendered empty on this prerendered route;\n the client fills it from the live query string. */}\n <div\n id=\"active-filters\"\n data-active-filters\n class:list={[\"mt-3 flex flex-wrap items-center gap-1.5 pb-6\", chips.length === 0 && \"hidden\"]}\n aria-label=\"Active filters\"\n >\n {chips.map((chip) => (\n <a href={chip.href} class={chipClass()} aria-label={`Remove filter: ${chip.label}`}>\n {chip.label} <span aria-hidden=\"true\">×</span>\n </a>\n ))}\n {chips.length > 0 && (\n <a\n href={clearFiltersHref}\n class=\"text-2xs font-medium text-ink-500 underline decoration-border underline-offset-2 hover:text-ink-900 dark:hover:text-ink-100\"\n aria-label=\"Clear all active filters\"\n >\n Clear all\n </a>\n )}\n </div>\n {chips.length === 0 && <div class=\"pb-6\"></div>}\n </div>\n</section>\n\n<section class=\"py-10 sm:py-12\">\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n {/* The count line IS the results heading — it carries a fact,\n which \"All projects / Every item in the directory\" did not,\n and it keeps the document's heading order intact above the\n cards' own h3s. */}\n {/* `tabindex=\"-1\"` lets the drawer's \"Show N\" button and the\n focus fallbacks in DirectoryIndexClient move focus here. */}\n <h2\n id=\"results-heading\"\n tabindex=\"-1\"\n class=\"m-0 mb-5 scroll-mt-4 text-2xs font-normal text-ink-500 dark:text-ink-400\"\n >\n <span id=\"results-count\" class=\"font-mono font-semibold text-ink-900 dark:text-ink-100\">\n {sorted.length} {sorted.length === 1 ? itemLabel() : itemLabelPlural()}\n </span>\n <span id=\"results-sort\">{` · sorted by ${sortDisplay(sort)}`}</span>\n <span id=\"results-page\">{pages > 1 ? ` · page ${page} of ${pages}` : \"\"}</span>\n </h2>\n\n {/* Screen readers hear the result count here, debounced by\n DirectoryIndexClient so rapid toggles make one announcement.\n The visible count above is deliberately not a live region,\n or every change would be announced twice. */}\n <p id=\"results-status\" class=\"sr-only\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\"></p>\n\n <CardGrid id=\"results-list\">\n {pageItems.map((item, i) => (\n <li class=\"m-0 p-0\" data-record-slug={item.slug}>\n <IndexRow\n record={item as Parameters<typeof IndexRow>[0][\"record\"]}\n detailHref={`/${slug}/${item.slug}/`}\n eager={i < 3}\n />\n </li>\n ))}\n </CardGrid>\n\n <div id=\"empty-state\" class:list={[\"py-12 text-center\", sorted.length > 0 && \"hidden\"]}>\n <p class=\"m-0 text-sm font-medium text-ink-700 dark:text-ink-200\">\n {`No ${itemLabelPlural()} match these filters.`}\n </p>\n {/* The client keeps this href in step with the live query, so\n clearing keeps the chosen sort, and on a scoped page it stays\n on that page. */}\n <Button href={clearFiltersHref} variant=\"secondary\" size=\"sm\" class=\"mt-4\" data-empty-reset>Clear filters</Button>\n </div>\n {/* Plain div wrapper — Pagination renders its own\n <nav aria-label=\"Pagination\">, so a nav here would nest two\n identical landmarks. */}\n <div id=\"results-pagination\" class=\"mt-8 flex flex-wrap items-center justify-center gap-1.5\">\n <Pagination current={page} total={pages} hrefFor={hrefForResultPage} />\n </div>\n </div>\n</section>\n\n<DirectoryIndexClient\n slug={slug}\n singular={itemLabel()}\n plural={itemLabelPlural()}\n taxonomy={taxonomy}\n routePage={page}\n scope={scoped ? scope : undefined}\n pathPrefix={pathPrefix}\n/>\n",
351
+ "content": "---\n/**\n * DirectoryBrowseView — the browse engine's body: search and sort, the\n * facet filters, the applied-filter chips, the results, and the client\n * controller that keeps all of it in step with the query string.\n *\n * Two kinds of page render it:\n * - `DirectoryBrowse` (`/{slug}/`, `/{slug}/page/{n}/`), which puts\n * its page header and lens tabs in the `header` slot.\n * - `TaxonomyList` (`/stacks/<id>/`, `/categories/<id>/`, …), which\n * passes a `scope` and its own `pathPrefix`.\n *\n * `scope` is an immutable slice of the directory, such as\n * `{ stacks: ['flutter'] }`. It is merged into every query, so results\n * and facet counts only ever come from the scoped set. It is never a\n * chip, its facet group is not rendered, and it never goes in the URL:\n * the page's own path already says it. Filters, sort and the query\n * live in that page's query string (`/stacks/flutter/?platform=ios`),\n * and \"Clear all\" or the zero-results reset lead back to the page\n * itself, so nothing can drop the scope.\n *\n * A scoped list is not paginated. The host page has no `/page/{n}/`\n * routes, so one prerendered document carries every record in the\n * scope, which keeps all of them linked without JavaScript. That is\n * what taxonomy pages rendered before they had filters.\n *\n * With no `scope` this renders exactly what `/{slug}/` always did.\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport { SORT_OPTIONS, sortDisplay } from '@grove-dev/astro';\nimport {\n getDirectoryIndexModel,\n itemLabel,\n itemLabelPlural,\n taxonomy,\n} from '@grove-dev/astro/server';\nimport { searchParamsFromFilters } from '@grove-dev/core';\nimport { chipClass } from '../../lib/classnames.ts';\nimport { type DirectoryScope, scopedGroups } from '../../lib/live-filters.ts';\nimport Button from '../ui/button.astro';\nimport FilterDrawer from '../ui/filter-drawer.astro';\nimport SearchField from '../ui/search-field.astro';\nimport CardGrid from './card-grid.astro';\nimport DirectoryIndexClient from './directory-index-client.astro';\nimport IndexRow from './index-row.astro';\nimport Pagination from './pagination.astro';\nimport RefinePanel from './refine-panel.astro';\n\ninterface Props {\n /** 1-based page this route renders. Ignored when `scope` is set. */\n routePage?: number;\n /**\n * Fixed filters for every query on this page, e.g.\n * `{ categories: ['productivity'] }`. Omit on the directory itself.\n */\n scope?: DirectoryScope;\n /**\n * Path the filtered URLs are built on, without a trailing slash.\n * Default: the directory route (`/{slug}`). A scoped page passes its\n * own path (`/stacks/flutter`).\n */\n pathPrefix?: string;\n}\n\nconst slug = siteConfig.blueprintConfig?.routeSlug ?? 'projects';\nconst { routePage = 1, scope, pathPrefix = `/${slug}` } = Astro.props;\nconst fixed = scopedGroups(scope);\nconst scoped = fixed.length > 0;\n\n// A scoped page asks the same model the directory uses, with the scope\n// as its query. Every facet's intersection count then already excludes\n// records outside the scope, and `sorted` is the scoped set. On an\n// unscoped page the build never sees a query, so this is empty.\nconst query = scoped\n ? searchParamsFromFilters(\n Object.fromEntries(fixed.map((group) => [group, [...(scope?.[group] ?? [])]])),\n )\n : Astro.url.searchParams;\nconst model = getDirectoryIndexModel(query, siteConfig, { page: scoped ? 1 : routePage });\nconst { filters, searchPlaceholder, sort, sorted } = model;\n\n// The scoped group is the page itself, not a choice: no facet for it,\n// and no chip. Nothing else the visitor picked exists at build time.\nconst facetGroups = model.facetGroups.filter(\n (group) => !fixed.includes(group.filterKey as (typeof fixed)[number]),\n);\nconst chips = scoped ? [] : model.chips;\nconst clearFiltersHref = scoped ? `${pathPrefix}/` : model.clearFiltersHref;\nconst pageItems = scoped ? sorted : model.pageItems;\nconst pages = scoped ? 1 : model.pages;\nconst page = scoped ? 1 : model.page;\nconst { hrefForResultPage } = model;\n---\n\n<section class=\"border-b border-border bg-background\">\n <div class:list={[\"mx-auto w-full max-w-container px-5 sm:px-7\", Astro.slots.has(\"header\") && \"pt-10 sm:pt-12\"]}>\n <slot name=\"header\" />\n\n {/* Row 1 — search and sort. Search filters as you type (see\n DirectoryIndexClient); the submit button is sr-only so Enter\n still works when JavaScript never arrives. */}\n <form\n method=\"get\"\n action={pathPrefix.endsWith(\"/\") ? pathPrefix : `${pathPrefix}/`}\n id=\"search-form\"\n class:list={[\"flex flex-col gap-2 sm:flex-row\", Astro.slots.has(\"header\") && \"mt-6\"]}\n role=\"search\"\n >\n <SearchField\n class=\"flex-1\"\n label={`Search ${itemLabelPlural()}`}\n value={filters.q ?? \"\"}\n placeholder={searchPlaceholder}\n shortcut\n />\n <label class=\"relative\">\n <span class=\"sr-only\">{`Sort ${itemLabelPlural()}`}</span>\n <select\n id=\"sort-select\"\n name=\"sort\"\n class=\"h-10 w-full cursor-pointer appearance-none rounded-md border border-input bg-background py-1.5 pl-3 pr-8 text-sm font-medium text-foreground transition-colors hover:border-ring focus:border-ring focus:outline-none focus:ring-2 focus:ring-ring/20 sm:w-auto\"\n >\n {SORT_OPTIONS.map((o) => (\n <option value={o.value} selected={o.value === sort}>{o.label}</option>\n ))}\n </select>\n <svg\n viewBox=\"0 0 16 16\"\n width=\"11\"\n height=\"11\"\n aria-hidden=\"true\"\n class=\"pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground\"\n fill=\"currentColor\"\n >\n <path d=\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\" />\n </svg>\n </label>\n <button type=\"submit\" class=\"sr-only\">Search</button>\n </form>\n\n {/* Row 2 — every filter on one line. On mobile they collapse into\n a full-width \"Filters (n)\" button opening a bottom sheet.\n Filters apply live in both places. The sheet's footer button\n (\"Show 12 apps\") just closes it and moves focus to the\n results heading. */}\n <div class=\"mt-3\">\n <FilterDrawer\n label=\"Filters\"\n activeCount={chips.length}\n clearHref={clearFiltersHref}\n resultsLabel={`Show ${sorted.length} ${sorted.length === 1 ? itemLabel() : itemLabelPlural()}`}\n resultsTarget=\"#results-heading\"\n >\n {/* The applied chips again, inside the sheet: on mobile the\n row above the list is behind the sheet. On desktop the\n filters render inline right above that row, so this copy\n stays hidden. DirectoryIndexClient fills both. The sheet's\n header already has \"Clear all\", so this row leaves it out. */}\n <div\n data-active-filters\n data-without-clear\n class:list={[\"mb-3 flex flex-wrap items-center gap-1.5 md:hidden\", chips.length === 0 && \"hidden\"]}\n aria-label=\"Active filters\"\n ></div>\n <RefinePanel\n class=\"max-md:flex-col max-md:items-stretch\"\n groups={facetGroups}\n initial={filters}\n pathPrefix={pathPrefix}\n hide={[\"sort\"]}\n />\n </FilterDrawer>\n </div>\n\n {/* Row 3 — what is currently narrowing the list, and one way out\n of all of it. Server-rendered empty on this prerendered route;\n the client fills it from the live query string. */}\n <div\n id=\"active-filters\"\n data-active-filters\n class:list={[\"mt-3 flex flex-wrap items-center gap-1.5 pb-6\", chips.length === 0 && \"hidden\"]}\n aria-label=\"Active filters\"\n >\n {chips.map((chip) => (\n <a href={chip.href} class={chipClass()} aria-label={`Remove filter: ${chip.label}`}>\n {chip.label} <span aria-hidden=\"true\">×</span>\n </a>\n ))}\n {chips.length > 0 && (\n <a\n href={clearFiltersHref}\n class=\"text-2xs font-medium text-ink-500 underline decoration-border underline-offset-2 hover:text-ink-900 dark:hover:text-ink-100\"\n aria-label=\"Clear all active filters\"\n >\n Clear all\n </a>\n )}\n </div>\n {chips.length === 0 && <div class=\"pb-6\"></div>}\n </div>\n</section>\n\n<section class=\"py-10 sm:py-12\">\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n {/* The count line IS the results heading — it carries a fact,\n which \"All projects / Every item in the directory\" did not,\n and it keeps the document's heading order intact above the\n cards' own h3s. */}\n {/* `tabindex=\"-1\"` lets the drawer's \"Show N\" button and the\n focus fallbacks in DirectoryIndexClient move focus here. */}\n <h2\n id=\"results-heading\"\n tabindex=\"-1\"\n class=\"m-0 mb-5 scroll-mt-4 text-2xs font-normal text-ink-500 dark:text-ink-400\"\n >\n <span id=\"results-count\" class=\"font-mono font-semibold text-ink-900 dark:text-ink-100\">\n {sorted.length} {sorted.length === 1 ? itemLabel() : itemLabelPlural()}\n </span>\n <span id=\"results-sort\">{` · sorted by ${sortDisplay(sort)}`}</span>\n <span id=\"results-page\">{pages > 1 ? ` · page ${page} of ${pages}` : \"\"}</span>\n </h2>\n\n {/* Screen readers hear the result count here, debounced by\n DirectoryIndexClient so rapid toggles make one announcement.\n The visible count above is deliberately not a live region,\n or every change would be announced twice. */}\n <p id=\"results-status\" class=\"sr-only\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\"></p>\n\n <CardGrid id=\"results-list\">\n {pageItems.map((item, i) => (\n <li class=\"m-0 p-0\" data-record-slug={item.slug}>\n <IndexRow\n record={item as Parameters<typeof IndexRow>[0][\"record\"]}\n detailHref={`/${slug}/${item.slug}/`}\n eager={i < 3}\n />\n </li>\n ))}\n </CardGrid>\n\n <div id=\"empty-state\" class:list={[\"py-12 text-center\", sorted.length > 0 && \"hidden\"]}>\n <p class=\"m-0 text-sm font-medium text-ink-700 dark:text-ink-200\">\n {`No ${itemLabelPlural()} match these filters.`}\n </p>\n {/* The client keeps this href in step with the live query, so\n clearing keeps the chosen sort, and on a scoped page it stays\n on that page. */}\n <Button href={clearFiltersHref} variant=\"secondary\" size=\"sm\" class=\"mt-4\" data-empty-reset>Clear filters</Button>\n </div>\n {/* Plain div wrapper — Pagination renders its own\n <nav aria-label=\"Pagination\">, so a nav here would nest two\n identical landmarks. */}\n <div id=\"results-pagination\" class=\"mt-8 flex flex-wrap items-center justify-center gap-1.5\">\n <Pagination current={page} total={pages} hrefFor={hrefForResultPage} />\n </div>\n </div>\n</section>\n\n<DirectoryIndexClient\n slug={slug}\n singular={itemLabel()}\n plural={itemLabelPlural()}\n taxonomy={taxonomy}\n routePage={page}\n scope={scoped ? scope : undefined}\n pathPrefix={pathPrefix}\n/>\n",
352
352
  "type": "registry:component",
353
353
  "target": "~/src/components/grove/directory-browse-view.astro"
354
354
  },
@@ -396,13 +396,13 @@
396
396
  },
397
397
  {
398
398
  "path": "default/lib/live-filters.ts",
399
- "content": "/**\n * Live-filter logic for the browse page. These are the pieces of\n * behaviour that do not need a DOM: URL building, the history-session\n * decision, the labels the page speaks, a debounce and the focus\n * fallback index.\n *\n * They live here, not inline in the `.astro` scripts, so they can be\n * unit-tested. RefinePanel, FilterDrawer and DirectoryIndexClient\n * import them.\n */\n\n/** The facet groups a scope can fix (core's `DirectoryFilterGroupKey`). */\nexport type ScopeGroup = 'stacks' | 'platforms' | 'categories' | 'tags' | 'licenses';\n\n/**\n * A fixed slice of the directory that a page browses inside, keyed by\n * facet group: `{ stacks: ['flutter'] }` on `/stacks/flutter/`,\n * `{ categories: ['productivity'] }` on `/categories/productivity/`.\n *\n * A scope is not a filter the visitor chose. It is merged into every\n * query, but it never shows as a chip or a facet, and it never goes in\n * the URL: the page's own path already says it. So clearing filters,\n * the zero-results reset and Back/Forward can never drop it.\n */\nexport type DirectoryScope = Partial<Record<ScopeGroup, readonly string[]>>;\n\n/** The facet groups a scope fixes. Groups with no values do not count. */\nexport function scopedGroups(scope: DirectoryScope | null | undefined): ScopeGroup[] {\n if (!scope) return [];\n return (Object.keys(scope) as ScopeGroup[]).filter((key) => (scope[key]?.length ?? 0) > 0);\n}\n\n/**\n * Drop the scoped groups from a filter state read off the URL. On\n * `/stacks/flutter/?stack=react` the `stack` parameter is ignored:\n * the page is Flutter, whatever the query says.\n */\nexport function withoutScope<F extends Partial<Record<ScopeGroup, unknown>>>(\n filters: F,\n scope: DirectoryScope | null | undefined,\n): F {\n const groups = scopedGroups(scope);\n if (groups.length === 0) return filters;\n const next = { ...filters };\n for (const group of groups) delete next[group];\n return next;\n}\n\n/**\n * The query string with the scoped groups' parameters removed, or\n * `null` when there was nothing to remove. The page uses it to tidy a\n * hand-written URL like `/stacks/flutter/?stack=react&platform=ios`.\n *\n * `paramKeys` maps a group to its URL key. Callers pass core's\n * `DIRECTORY_FILTER_KEYS`, so this file needs no package import.\n */\nexport function searchWithoutScope(\n search: string,\n scope: DirectoryScope | null | undefined,\n paramKeys: Readonly<Record<ScopeGroup, string>>,\n): string | null {\n const groups = scopedGroups(scope);\n const params = new URLSearchParams(search);\n let changed = false;\n for (const group of groups) {\n const key = paramKeys[group];\n if (params.has(key)) {\n params.delete(key);\n changed = true;\n }\n }\n if (!changed) return null;\n const query = params.toString();\n return query ? `?${query}` : '';\n}\n\n/**\n * URL for one facet group's new selection. Every other parameter in\n * `search` is kept, so the query, other groups, sort and lens survive.\n * The group's key is rewritten and `page` is dropped, because a\n * different result set starts on page 1.\n *\n * This is the same URL shape the page has always used: a repeated key\n * per value. Existing links keep working.\n */\nexport function hrefForGroupSelection(\n search: string,\n pathPrefix: string,\n paramKey: string,\n values: readonly string[],\n): string {\n const params = new URLSearchParams(search);\n params.delete(paramKey);\n params.delete('page');\n for (const value of values) if (value) params.append(paramKey, value);\n const query = params.toString();\n return query ? `${pathPrefix}?${query}` : pathPrefix;\n}\n\n/**\n * Whether the browse page can show `target` in place, or must really\n * navigate to it.\n *\n * A URL with a query is always a client view of the list, so it can\n * be shown in place. A URL with no query is a prerendered document.\n * On page 1 of the same list that is the document already on screen,\n * so clearing the last filter can still happen in place, keeping focus\n * and an open drawer. From `/{slug}/page/2/`, or for a different path,\n * it is a different document and has to load for real. Otherwise page\n * 2's records would sit under the page-1 URL.\n */\nexport function canAdoptInPlace(\n target: { pathname: string; search: string },\n currentPathname: string,\n routePage: number,\n): boolean {\n if (target.search) return true;\n const strip = (path: string) => path.replace(/\\/$/, '');\n return strip(target.pathname) === strip(currentPathname) && routePage <= 1;\n}\n\n/** What a filter change does to the history stack. */\nexport type HistoryMode = 'push' | 'replace';\n\n/** Where the history stood when a filter session opened. */\nexport interface HistorySnapshot {\n url: string;\n scrollY: number;\n}\n\n/**\n * The history entries a closing session has to write: put `start` back\n * on the current entry, then push `end`.\n */\nexport interface HistoryCommit {\n start: HistorySnapshot;\n end: string;\n}\n\n/**\n * One \"filter session\": the time a filter surface (a facet popover or\n * the mobile drawer) is open.\n *\n * While a session is open, each change replaces the current history\n * entry, so ticking five checkboxes does not leave five Back steps.\n * When the last surface closes and the URL has changed, the caller\n * restores the starting URL on the current entry and pushes the final\n * one. That is one pushState per session, and Back goes to the result\n * set from before the session.\n *\n * Surfaces nest: a popover can open inside the drawer. The session\n * only ends when every surface has closed.\n */\nexport class FilterHistorySession {\n #open = new Set<string>();\n #start: HistorySnapshot | null = null;\n\n /** True while at least one filter surface is open. */\n get active(): boolean {\n return this.#open.size > 0;\n }\n\n /** A surface opened. The first one records where history stood. */\n open(surface: string, snapshot: HistorySnapshot): void {\n if (this.#open.size === 0) this.#start = snapshot;\n this.#open.add(surface);\n }\n\n /** How a filter change made now should write to history. */\n modeForChange(): HistoryMode {\n return this.active ? 'replace' : 'push';\n }\n\n /**\n * A surface closed. Returns the commit to write when this ended the\n * session and the URL changed during it. Otherwise returns `null`:\n * another surface is still open, the surface was not open, or\n * nothing changed.\n */\n close(surface: string, currentUrl: string): HistoryCommit | null {\n if (!this.#open.delete(surface) || this.#open.size > 0) return null;\n const start = this.#start;\n this.#start = null;\n if (!start || sameUrl(start.url, currentUrl)) return null;\n return { start, end: currentUrl };\n }\n\n /**\n * Back/Forward moved to another entry while a surface was open. The\n * new entry becomes the session's starting point: later changes\n * replace it, and closing pushes one entry after it. When no session\n * is open this does nothing.\n */\n rebase(snapshot: HistorySnapshot): void {\n if (this.active) this.#start = snapshot;\n }\n}\n\n/** Compare two same-origin URLs, ignoring a trailing slash on the path. */\nfunction sameUrl(a: string, b: string): boolean {\n const left = new URL(a, 'https://grove.invalid');\n const right = new URL(b, 'https://grove.invalid');\n const path = (url: URL) => url.pathname.replace(/\\/$/, '');\n return path(left) === path(right) && left.search === right.search;\n}\n\n/** `1 app`, `12 apps`. */\nexport function countLabel(count: number, singular: string, plural: string): string {\n return `${count} ${count === 1 ? singular : plural}`;\n}\n\n/**\n * What the polite live region says after the results change. It is a\n * whole sentence because a screen reader hears it without the visible\n * heading around it.\n */\nexport function resultsAnnouncement(count: number, singular: string, plural: string): string {\n if (count === 0) return `No ${plural} match these filters.`;\n return `${countLabel(count, singular, plural)} found.`;\n}\n\n/**\n * Label for the mobile drawer's results button. The button shows the\n * results. It does not apply anything, because every change has\n * already applied.\n */\nexport function showResultsLabel(\n count: number,\n singular: string,\n plural: string,\n pending = false,\n): string {\n if (pending) return 'Updating results…';\n if (count === 0) return `No ${plural} match`;\n return `Show ${countLabel(count, singular, plural)}`;\n}\n\n/** A trailing-edge debounce that can also be cancelled. */\nexport interface Debounced<Args extends unknown[]> {\n (...args: Args): void;\n cancel(): void;\n}\n\nexport function debounce<Args extends unknown[]>(\n fn: (...args: Args) => void,\n wait: number,\n): Debounced<Args> {\n let timer: ReturnType<typeof setTimeout> | undefined;\n const debounced = (...args: Args) => {\n if (timer !== undefined) clearTimeout(timer);\n timer = setTimeout(() => {\n timer = undefined;\n fn(...args);\n }, wait);\n };\n debounced.cancel = () => {\n if (timer !== undefined) clearTimeout(timer);\n timer = undefined;\n };\n return debounced;\n}\n\n/**\n * When a list re-renders under a focused item (for example, removing\n * the focused chip), this picks which item gets focus next. The answer\n * is the item that took the old one's place, or the new last item.\n * Returns `-1` when the list is empty and the caller has to fall back\n * to something else.\n */\nexport function focusIndexAfterRender(previousIndex: number, length: number): number {\n if (length <= 0) return -1;\n return Math.min(Math.max(previousIndex, 0), length - 1);\n}\n",
399
+ "content": "/**\n * Live-filter logic for the browse page. These are the pieces of\n * behaviour that do not need a DOM: URL building, the history-session\n * decision, the labels the page speaks, a debounce and the focus\n * fallback index.\n *\n * They live here, not inline in the `.astro` scripts, so they can be\n * unit-tested. RefinePanel, FilterDrawer and DirectoryIndexClient\n * import them.\n */\n\n/** The facet groups a scope can fix (core's `DirectoryFilterGroupKey`). */\nexport type ScopeGroup = 'stacks' | 'platforms' | 'categories' | 'tags' | 'licenses';\n\n/**\n * A fixed slice of the directory that a page browses inside, keyed by\n * facet group: `{ stacks: ['flutter'] }` on `/stacks/flutter/`,\n * `{ categories: ['productivity'] }` on `/categories/productivity/`.\n *\n * A scope is not a filter the visitor chose. It is merged into every\n * query, but it never shows as a chip or a facet, and it never goes in\n * the URL: the page's own path already says it. So clearing filters,\n * the zero-results reset and Back/Forward can never drop it.\n */\nexport type DirectoryScope = Partial<Record<ScopeGroup, readonly string[]>>;\n\n/** The facet groups a scope fixes. Groups with no values do not count. */\nexport function scopedGroups(scope: DirectoryScope | null | undefined): ScopeGroup[] {\n if (!scope) return [];\n return (Object.keys(scope) as ScopeGroup[]).filter((key) => (scope[key]?.length ?? 0) > 0);\n}\n\n/**\n * Drop the scoped groups from a filter state read off the URL. On\n * `/stacks/flutter/?stack=react` the `stack` parameter is ignored:\n * the page is Flutter, whatever the query says.\n */\nexport function withoutScope<F extends Partial<Record<ScopeGroup, unknown>>>(\n filters: F,\n scope: DirectoryScope | null | undefined,\n): F {\n const groups = scopedGroups(scope);\n if (groups.length === 0) return filters;\n const next = { ...filters };\n for (const group of groups) delete next[group];\n return next;\n}\n\n/**\n * The query string with the scoped groups' parameters removed, or\n * `null` when there was nothing to remove. The page uses it to tidy a\n * hand-written URL like `/stacks/flutter/?stack=react&platform=ios`.\n *\n * `paramKeys` maps a group to its URL key. Callers pass core's\n * `DIRECTORY_FILTER_KEYS`, so this file needs no package import.\n */\nexport function searchWithoutScope(\n search: string,\n scope: DirectoryScope | null | undefined,\n paramKeys: Readonly<Record<ScopeGroup, string>>,\n): string | null {\n const groups = scopedGroups(scope);\n const params = new URLSearchParams(search);\n let changed = false;\n for (const group of groups) {\n const key = paramKeys[group];\n if (params.has(key)) {\n params.delete(key);\n changed = true;\n }\n }\n if (!changed) return null;\n const query = params.toString();\n return query ? `?${query}` : '';\n}\n\n/**\n * URL for one facet group's new selection. Every other parameter in\n * `search` is kept, so the query, other groups, sort and lens survive.\n * The group's key is rewritten and `page` is dropped, because a\n * different result set starts on page 1.\n *\n * This is the same URL shape the page has always used: a repeated key\n * per value. Existing links keep working.\n */\nexport function hrefForGroupSelection(\n search: string,\n pathPrefix: string,\n paramKey: string,\n values: readonly string[],\n): string {\n const params = new URLSearchParams(search);\n params.delete(paramKey);\n params.delete('page');\n for (const value of values) if (value) params.append(paramKey, value);\n const query = params.toString();\n // The list is `/apps/`; `/apps` is only a redirect to it (core's\n // `directoryHref` follows the same rule).\n const base = pathPrefix === '' || pathPrefix.endsWith('/') ? pathPrefix : `${pathPrefix}/`;\n return query ? `${base}?${query}` : base;\n}\n\n/**\n * Whether the browse page can show `target` in place, or must really\n * navigate to it.\n *\n * A URL with a query is always a client view of the list, so it can\n * be shown in place. A URL with no query is a prerendered document.\n * On page 1 of the same list that is the document already on screen,\n * so clearing the last filter can still happen in place, keeping focus\n * and an open drawer. From `/{slug}/page/2/`, or for a different path,\n * it is a different document and has to load for real. Otherwise page\n * 2's records would sit under the page-1 URL.\n */\nexport function canAdoptInPlace(\n target: { pathname: string; search: string },\n currentPathname: string,\n routePage: number,\n): boolean {\n if (target.search) return true;\n const strip = (path: string) => path.replace(/\\/$/, '');\n return strip(target.pathname) === strip(currentPathname) && routePage <= 1;\n}\n\n/** What a filter change does to the history stack. */\nexport type HistoryMode = 'push' | 'replace';\n\n/** Where the history stood when a filter session opened. */\nexport interface HistorySnapshot {\n url: string;\n scrollY: number;\n}\n\n/**\n * The history entries a closing session has to write: put `start` back\n * on the current entry, then push `end`.\n */\nexport interface HistoryCommit {\n start: HistorySnapshot;\n end: string;\n}\n\n/**\n * One \"filter session\": the time a filter surface (a facet popover or\n * the mobile drawer) is open.\n *\n * While a session is open, each change replaces the current history\n * entry, so ticking five checkboxes does not leave five Back steps.\n * When the last surface closes and the URL has changed, the caller\n * restores the starting URL on the current entry and pushes the final\n * one. That is one pushState per session, and Back goes to the result\n * set from before the session.\n *\n * Surfaces nest: a popover can open inside the drawer. The session\n * only ends when every surface has closed.\n */\nexport class FilterHistorySession {\n #open = new Set<string>();\n #start: HistorySnapshot | null = null;\n\n /** True while at least one filter surface is open. */\n get active(): boolean {\n return this.#open.size > 0;\n }\n\n /** A surface opened. The first one records where history stood. */\n open(surface: string, snapshot: HistorySnapshot): void {\n if (this.#open.size === 0) this.#start = snapshot;\n this.#open.add(surface);\n }\n\n /** How a filter change made now should write to history. */\n modeForChange(): HistoryMode {\n return this.active ? 'replace' : 'push';\n }\n\n /**\n * A surface closed. Returns the commit to write when this ended the\n * session and the URL changed during it. Otherwise returns `null`:\n * another surface is still open, the surface was not open, or\n * nothing changed.\n */\n close(surface: string, currentUrl: string): HistoryCommit | null {\n if (!this.#open.delete(surface) || this.#open.size > 0) return null;\n const start = this.#start;\n this.#start = null;\n if (!start || sameUrl(start.url, currentUrl)) return null;\n return { start, end: currentUrl };\n }\n\n /**\n * Back/Forward moved to another entry while a surface was open. The\n * new entry becomes the session's starting point: later changes\n * replace it, and closing pushes one entry after it. When no session\n * is open this does nothing.\n */\n rebase(snapshot: HistorySnapshot): void {\n if (this.active) this.#start = snapshot;\n }\n}\n\n/** Compare two same-origin URLs, ignoring a trailing slash on the path. */\nfunction sameUrl(a: string, b: string): boolean {\n const left = new URL(a, 'https://grove.invalid');\n const right = new URL(b, 'https://grove.invalid');\n const path = (url: URL) => url.pathname.replace(/\\/$/, '');\n return path(left) === path(right) && left.search === right.search;\n}\n\n/** `1 app`, `12 apps`. */\nexport function countLabel(count: number, singular: string, plural: string): string {\n return `${count} ${count === 1 ? singular : plural}`;\n}\n\n/**\n * What the polite live region says after the results change. It is a\n * whole sentence because a screen reader hears it without the visible\n * heading around it.\n */\nexport function resultsAnnouncement(count: number, singular: string, plural: string): string {\n if (count === 0) return `No ${plural} match these filters.`;\n return `${countLabel(count, singular, plural)} found.`;\n}\n\n/**\n * Label for the mobile drawer's results button. The button shows the\n * results. It does not apply anything, because every change has\n * already applied.\n */\nexport function showResultsLabel(\n count: number,\n singular: string,\n plural: string,\n pending = false,\n): string {\n if (pending) return 'Updating results…';\n if (count === 0) return `No ${plural} match`;\n return `Show ${countLabel(count, singular, plural)}`;\n}\n\n/** A trailing-edge debounce that can also be cancelled. */\nexport interface Debounced<Args extends unknown[]> {\n (...args: Args): void;\n cancel(): void;\n}\n\nexport function debounce<Args extends unknown[]>(\n fn: (...args: Args) => void,\n wait: number,\n): Debounced<Args> {\n let timer: ReturnType<typeof setTimeout> | undefined;\n const debounced = (...args: Args) => {\n if (timer !== undefined) clearTimeout(timer);\n timer = setTimeout(() => {\n timer = undefined;\n fn(...args);\n }, wait);\n };\n debounced.cancel = () => {\n if (timer !== undefined) clearTimeout(timer);\n timer = undefined;\n };\n return debounced;\n}\n\n/**\n * When a list re-renders under a focused item (for example, removing\n * the focused chip), this picks which item gets focus next. The answer\n * is the item that took the old one's place, or the new last item.\n * Returns `-1` when the list is empty and the caller has to fall back\n * to something else.\n */\nexport function focusIndexAfterRender(previousIndex: number, length: number): number {\n if (length <= 0) return -1;\n return Math.min(Math.max(previousIndex, 0), length - 1);\n}\n",
400
400
  "type": "registry:file",
401
401
  "target": "~/src/lib/live-filters.ts"
402
402
  },
403
403
  {
404
404
  "path": "default/pages/[slug]/[recordSlug].astro",
405
- "content": "---\n/**\n * Detail page — thin consumer wiring up the package's\n * RecordHeader, EditorialSummary, TableOfContents, MarkdownBody,\n * and RecordSidebar components. All rendering logic, prose\n * styling, sidebar visibility, and activity-badge rules live in\n * `@grove-dev/astro`; this file only composes them.\n */\nimport records from '@grove/generated/records.json';\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getRecordContextModel,\n getRecordDetailModel,\n loadCollections,\n recordDetailPaths,\n recordsToCollectionEntries,\n} from '@grove-dev/astro/server';\nimport EditorialSummary from '../../components/grove/editorial-summary.astro';\nimport MarkdownBody from '../../components/grove/markdown-body.astro';\nimport RecordHeader from '../../components/grove/record-header.astro';\nimport RecordRelations from '../../components/grove/record-relations.astro';\nimport RecordSidebar from '../../components/grove/record-sidebar.astro';\nimport RelatedRecords from '../../components/grove/related-records.astro';\nimport TableOfContents from '../../components/grove/table-of-contents.astro';\nimport BaseLayout from '../../layouts/base-layout.astro';\n\nexport function getStaticPaths() {\n return recordDetailPaths(siteConfig);\n}\n\nconst dirSlug = siteConfig.blueprintConfig?.routeSlug ?? 'projects';\nconst detail = getRecordDetailModel(\n Astro.params.recordSlug ?? '',\n siteConfig,\n Astro.params.slug ?? dirSlug,\n);\nif (!detail) return Astro.redirect(`/${dirSlug}`);\nconst { record, itemSingular, seo } = detail;\n\n// Where this page links out to: subject hubs, sibling records, and the\n// collections the record appears in.\nconst context = getRecordContextModel(record, {\n collections: await loadCollections(process.cwd()),\n entries: recordsToCollectionEntries(\n (records as { records: unknown[] }).records as never,\n siteConfig,\n ),\n subjects: siteConfig.taxonomy?.subjects ?? [],\n});\n---\n\n<BaseLayout\n title={seo.title}\n description={seo.description}\n image={seo.image}\n imageAlt={seo.imageAlt}\n site={siteConfig}\n type=\"article\"\n jsonLd={seo.jsonLd}\n noindex={seo.noindex}\n robots={seo.robots}\n submitHref=\"/submit\"\n submitLabel={`Submit ${itemSingular}`}\n>\n <article class=\"py-8 sm:py-10\">\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n <RecordHeader detail={detail} />\n <RecordRelations relations={context.relations} />\n\n <div\n class=\"grid grid-cols-1 gap-10 lg:grid-cols-[minmax(0,1fr)_300px] lg:gap-12\"\n >\n {/* Reading column: editorial context, then the article —\n no TOC panel pushing the body down. */}\n <div class=\"min-w-0\">\n <EditorialSummary\n bestFor={detail.bestFor}\n caveats={detail.caveats}\n whyListed={detail.whyListed}\n />\n <MarkdownBody\n recordSlug={record.slug}\n fallback={record.content ? \"This record doesn't have notes yet.\" : undefined}\n />\n </div>\n {/* Right rail: the TOC and nothing else. */}\n <div class=\"min-w-0 lg:sticky lg:top-20 lg:max-h-[calc(100vh-5rem)] lg:self-start lg:overflow-y-auto\">\n <TableOfContents items={detail.toc} />\n </div>\n </div>\n\n <RelatedRecords context={context} />\n\n {/* Metadata panels — full width below the article. */}\n <section class=\"mt-12 border-t border-border pt-8\" aria-label=\"Project details\">\n <RecordSidebar detail={detail} sticky={false} layout=\"grid\" />\n </section>\n </div>\n </article>\n</BaseLayout>\n",
405
+ "content": "---\n/**\n * Detail page — thin consumer wiring up the package's\n * RecordHeader, EditorialSummary, TableOfContents, MarkdownBody,\n * and RecordSidebar components. All rendering logic, prose\n * styling, sidebar visibility, and activity-badge rules live in\n * `@grove-dev/astro`; this file only composes them.\n */\nimport records from '@grove/generated/records.json';\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getRecordContextModel,\n getRecordDetailModel,\n loadCollections,\n recordDetailPaths,\n recordsToCollectionEntries,\n} from '@grove-dev/astro/server';\nimport EditorialSummary from '../../components/grove/editorial-summary.astro';\nimport MarkdownBody from '../../components/grove/markdown-body.astro';\nimport RecordHeader from '../../components/grove/record-header.astro';\nimport RecordRelations from '../../components/grove/record-relations.astro';\nimport RecordSidebar from '../../components/grove/record-sidebar.astro';\nimport RelatedRecords from '../../components/grove/related-records.astro';\nimport TableOfContents from '../../components/grove/table-of-contents.astro';\nimport BaseLayout from '../../layouts/base-layout.astro';\n\nexport function getStaticPaths() {\n return recordDetailPaths(siteConfig);\n}\n\nconst dirSlug = siteConfig.blueprintConfig?.routeSlug ?? 'projects';\nconst detail = getRecordDetailModel(\n Astro.params.recordSlug ?? '',\n siteConfig,\n Astro.params.slug ?? dirSlug,\n);\nif (!detail) return Astro.redirect(`/${dirSlug}/`);\nconst { record, itemSingular, seo } = detail;\n\n// Where this page links out to: subject hubs, sibling records, and the\n// collections the record appears in.\nconst context = getRecordContextModel(record, {\n collections: await loadCollections(process.cwd()),\n entries: recordsToCollectionEntries(\n (records as { records: unknown[] }).records as never,\n siteConfig,\n ),\n subjects: siteConfig.taxonomy?.subjects ?? [],\n});\n---\n\n<BaseLayout\n title={seo.title}\n description={seo.description}\n image={seo.image}\n imageAlt={seo.imageAlt}\n site={siteConfig}\n type=\"article\"\n jsonLd={seo.jsonLd}\n noindex={seo.noindex}\n robots={seo.robots}\n submitHref=\"/submit/\"\n submitLabel={`Submit ${itemSingular}`}\n>\n <article class=\"py-8 sm:py-10\">\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n <RecordHeader detail={detail} />\n <RecordRelations relations={context.relations} />\n\n <div\n class=\"grid grid-cols-1 gap-10 lg:grid-cols-[minmax(0,1fr)_300px] lg:gap-12\"\n >\n {/* Reading column: editorial context, then the article —\n no TOC panel pushing the body down. */}\n <div class=\"min-w-0\">\n <EditorialSummary\n bestFor={detail.bestFor}\n caveats={detail.caveats}\n whyListed={detail.whyListed}\n />\n <MarkdownBody\n recordSlug={record.slug}\n fallback={record.content ? \"This record doesn't have notes yet.\" : undefined}\n />\n </div>\n {/* Right rail: the TOC and nothing else. */}\n <div class=\"min-w-0 lg:sticky lg:top-20 lg:max-h-[calc(100vh-5rem)] lg:self-start lg:overflow-y-auto\">\n <TableOfContents items={detail.toc} />\n </div>\n </div>\n\n <RelatedRecords context={context} />\n\n {/* Metadata panels — full width below the article. */}\n <section class=\"mt-12 border-t border-border pt-8\" aria-label=\"Project details\">\n <RecordSidebar detail={detail} sticky={false} layout=\"grid\" />\n </section>\n </div>\n </article>\n</BaseLayout>\n",
406
406
  "type": "registry:page",
407
407
  "target": "~/src/pages/[slug]/[recordSlug].astro"
408
408
  },
@@ -414,7 +414,7 @@
414
414
  },
415
415
  {
416
416
  "path": "default/components/grove/record-sidebar.astro",
417
- "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 ? // Full width under the article: a flat band of columns, not a wall of\n // boxes of uneven height. Cards lose their frame here; the badge and\n // source notes sit on their own row below.\n \"grove-sidebar grid grid-cols-1 items-start gap-x-10 gap-y-8 sm:grid-cols-2 xl:grid-cols-4 [&>.grove-card]:rounded-none [&>.grove-card]:border-0 [&>.grove-card]:bg-transparent [&>.grove-card]:p-0\"\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 {/* Two clocks, named apart: when a person last reviewed the page,\n and when the repository numbers were last synced. */}\n {reviewedAtLabel && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Editorial review</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">\n <time datetime={String(record.curation?.reviewedAt)}>{reviewedAtLabel}</time>\n </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\">Repository data</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 <div class:list={[layout === \"grid\" && \"border-t border-border pt-6 sm:col-start-1 xl:col-span-2 [&>.grove-card]:rounded-none [&>.grove-card]:border-0 [&>.grove-card]:bg-transparent [&>.grove-card]:p-0\"]}>\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 </div>\n\n {/* ── Source card (small) ────────────────────────────────── */}\n {sidebar.showSource && (\n <section\n class:list={[layout === \"grid\" && \"!border-t !border-solid !border-border !pt-6 xl:col-span-2\", \"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>",
417
+ "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 { hrefForFilters, 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 ? // Full width under the article: a flat band of columns, not a wall of\n // boxes of uneven height. Cards lose their frame here; the badge and\n // source notes sit on their own row below.\n \"grove-sidebar grid grid-cols-1 items-start gap-x-10 gap-y-8 sm:grid-cols-2 xl:grid-cols-4 [&>.grove-card]:rounded-none [&>.grove-card]:border-0 [&>.grove-card]:bg-transparent [&>.grove-card]:p-0\"\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 {/* Two clocks, named apart: when a person last reviewed the page,\n and when the repository numbers were last synced. */}\n {reviewedAtLabel && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Editorial review</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">\n <time datetime={String(record.curation?.reviewedAt)}>{reviewedAtLabel}</time>\n </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\">Repository data</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={hrefForFilters({ tags: [t] }, `/${detail.slug}`)} 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 <div class:list={[layout === \"grid\" && \"border-t border-border pt-6 sm:col-start-1 xl:col-span-2 [&>.grove-card]:rounded-none [&>.grove-card]:border-0 [&>.grove-card]:bg-transparent [&>.grove-card]:p-0\"]}>\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 </div>\n\n {/* ── Source card (small) ────────────────────────────────── */}\n {sidebar.showSource && (\n <section\n class:list={[layout === \"grid\" && \"!border-t !border-solid !border-border !pt-6 xl:col-span-2\", \"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>",
418
418
  "type": "registry:component",
419
419
  "target": "~/src/components/grove/record-sidebar.astro"
420
420
  },
@@ -462,7 +462,7 @@
462
462
  },
463
463
  {
464
464
  "path": "default/pages/submit.astro",
465
- "content": "---\nimport siteConfig from '@grove/generated/site-config.json';\nimport { getSubmissionPageModel } from '@grove-dev/astro/server';\nimport SubmissionClient from '../components/grove/submission-client.astro';\nimport BaseLayout from '../layouts/base-layout.astro';\nimport Container from '../layouts/container.astro';\nimport { buttonClass } from '../lib/classnames.ts';\n\nconst {\n singular,\n title,\n description,\n repoUrl,\n copy,\n fields,\n categories,\n stacks,\n existingSlugs,\n existingFullNames,\n platformOptions,\n licenseOptions,\n taxonomy,\n} = getSubmissionPageModel(siteConfig);\nconst goodSubmissions = [\n ...(copy.good?.length\n ? copy.good\n : [\n `A real, usable ${singular}, not a tutorial or one-screen demo`,\n 'A public repository with a clear open-source license',\n 'Enough documentation to understand, run, or contribute',\n 'Recent maintenance, releases, or meaningful project history',\n ]),\n];\nconst pleaseAvoid = [\n ...(copy.avoid?.length\n ? copy.avoid\n : [\n 'Snippets, exercises, abandoned experiments, or duplicate entries',\n 'Private repositories or projects without source',\n 'Marketing pages with no usable project behind them',\n 'Records with no license or verifiable repository',\n ]),\n];\n\n// Shared control styling.\nconst control =\n 'min-h-10 w-full rounded-[var(--radius)] border border-input bg-background px-3 py-2 text-sm text-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/35';\nconst labelText = 'text-sm font-medium text-foreground';\nconst hint = 'text-2xs leading-relaxed text-muted-foreground';\nconst steps = [\n { id: 'repo', title: 'Repository', text: 'Paste the GitHub URL' },\n { id: 'details', title: 'Details', text: 'Say what it is and who it is for' },\n { id: 'review', title: 'Open the pull request', text: 'Check the preview, open one PR' },\n];\n---\n\n<BaseLayout\n title={title}\n description={description}\n noindex\n site={siteConfig}\n submitHref=\"/submit\"\n>\n <div class=\"border-b border-border bg-surface-sunken/60\">\n <Container>\n <section class=\"py-10 sm:py-14\">\n <p class=\"m-0 text-2xs font-semibold uppercase tracking-wider text-muted-foreground\">\n {copy.eyebrow ?? `${singular} submission`}\n </p>\n <h1 class=\"m-0 mt-2 text-[2rem] font-semibold leading-tight tracking-tight text-foreground sm:text-[2.5rem]\">\n {copy.title ?? `Add ${singular === \"app\" ? \"an\" : \"a\"} ${singular} to the directory`}\n </h1>\n <p class=\"m-0 mt-3 max-w-[62ch] text-[1rem] leading-relaxed text-muted-foreground\">\n {copy.description ?? description}\n </p>\n <ul class=\"m-0 mt-5 flex list-none flex-wrap gap-2 p-0 text-2xs\">\n {[\"No account on this site\", \"Reviewed by a person\", \"Credited on the page\", \"README badge for maintainers\"].map((item) => (\n <li class=\"inline-flex items-center gap-1.5 rounded-full border border-border bg-background px-2.5 py-1 font-medium text-foreground\">\n <svg viewBox=\"0 0 16 16\" width=\"11\" height=\"11\" aria-hidden=\"true\" fill=\"currentColor\" class=\"text-success\"><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\" /></svg>\n {item}\n </li>\n ))}\n </ul>\n\n <ol id=\"submit-steps\" class=\"m-0 mt-8 grid list-none grid-cols-1 gap-2 p-0 sm:grid-cols-3\" aria-label=\"Submission steps\">\n {steps.map((step, i) => (\n <li data-step={step.id} data-state={i === 0 ? \"current\" : \"todo\"} class=\"group flex items-center gap-3 rounded-[var(--radius-lg)] border border-border bg-background px-3 py-2.5 data-[state=current]:border-foreground data-[state=done]:border-success/50\">\n <span class=\"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-border text-xs font-semibold tabular-nums text-muted-foreground group-data-[state=current]:border-foreground group-data-[state=current]:bg-foreground group-data-[state=current]:text-background group-data-[state=done]:border-success group-data-[state=done]:bg-success group-data-[state=done]:text-background\">\n <span class=\"group-data-[state=done]:hidden\">{i + 1}</span>\n <svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" aria-hidden=\"true\" fill=\"currentColor\" class=\"hidden group-data-[state=done]:block\"><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\" /></svg>\n </span>\n <span class=\"min-w-0\">\n <span class=\"block text-sm font-semibold text-foreground\">{step.title}</span>\n <span class=\"block truncate text-2xs text-muted-foreground\">{step.text}</span>\n </span>\n </li>\n ))}\n </ol>\n </section>\n </Container>\n </div>\n\n <Container>\n <div class=\"grid grid-cols-1 items-start gap-6 py-8 sm:py-10 lg:grid-cols-[minmax(0,1fr)_minmax(320px,0.8fr)]\">\n <form id=\"submit-form\" class=\"grid gap-6\" novalidate>\n {/* ── 1. Repository ───────────────────────────── */}\n <section aria-labelledby=\"step-repo\" class=\"rounded-[var(--radius-lg)] border border-border bg-card p-5 sm:p-6\">\n <h2 id=\"step-repo\" class=\"m-0 flex items-center gap-2 text-[1.0625rem] font-semibold text-foreground\">\n <span class=\"text-muted-foreground\">1.</span> Repository\n </h2>\n <label class=\"mt-4 grid gap-1.5\">\n <span class={labelText}>GitHub URL</span>\n <div class=\"flex flex-col gap-2 sm:flex-row\">\n <input id=\"repo-url\" type=\"url\" required autocomplete=\"off\" placeholder=\"https://github.com/owner/repo\" class={`${control} min-h-11 text-[0.9375rem] sm:flex-1`} />\n <button id=\"fetch-repo\" type=\"button\" class={buttonClass(\"primary\", \"bare\", \"min-h-11 whitespace-nowrap px-4 text-sm\")}>Fetch details</button>\n </div>\n <span class={hint}>Public repositories only. We read it from the GitHub API and never write to it.</span>\n </label>\n <div id=\"repo-card\" hidden class=\"mt-4 flex items-start gap-3 rounded-[var(--radius)] border border-border bg-background p-3\">\n <img id=\"repo-avatar\" src=\"data:,\" alt=\"\" width=\"40\" height=\"40\" class=\"h-10 w-10 shrink-0 rounded-lg border border-border object-cover\" />\n <div class=\"min-w-0 flex-1\">\n <p id=\"repo-name\" class=\"m-0 truncate text-sm font-semibold text-foreground\"></p>\n <p id=\"repo-description\" class=\"m-0 mt-0.5 line-clamp-2 text-2xs text-muted-foreground\"></p>\n <p id=\"repo-facts\" class=\"m-0 mt-1.5 flex flex-wrap gap-x-3 text-2xs text-muted-foreground\"></p>\n </div>\n </div>\n </section>\n\n {/* ── 2. Details ──────────────────────────────── */}\n <section aria-labelledby=\"step-details\" class=\"rounded-[var(--radius-lg)] border border-border bg-card p-5 sm:p-6\">\n <h2 id=\"step-details\" class=\"m-0 flex items-center gap-2 text-[1.0625rem] font-semibold text-foreground\">\n <span class=\"text-muted-foreground\">2.</span> About the {singular}\n </h2>\n <p class=\"m-0 mt-1 text-2xs text-muted-foreground\">Filled from GitHub where possible — edit anything that reads like a README.</p>\n\n <div class=\"mt-5 grid gap-5\">\n <div class=\"grid grid-cols-1 items-start gap-4 sm:grid-cols-[minmax(0,1fr)_14rem]\">\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Name</span>\n <input id=\"item-name\" type=\"text\" class={control} />\n </label>\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Page address</span>\n <input id=\"item-slug\" type=\"text\" class={`${control} font-mono`} />\n <span class={hint}>The last part of the page URL — from the repo name.</span>\n </label>\n </div>\n\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Description</span>\n <textarea id=\"item-description\" rows=\"3\" class={`${control} resize-y`}></textarea>\n <span class={hint}>One or two plain sentences: what it is and who it is for. At least 40 characters.</span>\n </label>\n\n {(fields.category || fields.stack) && (\n <div class:list={[\"grid grid-cols-1 gap-4\", fields.category && fields.stack && \"sm:grid-cols-2\"]}>\n {fields.category && (\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Category</span>\n <select id=\"item-category\" class={control}>\n <option value=\"\">Choose a category</option>\n {categories.map((option) => <option value={option.id}>{option.label}</option>)}\n </select>\n </label>\n )}\n {fields.stack && (\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Primary stack</span>\n <select id=\"primary-stack\" class={control}>\n <option value=\"\">Choose a stack</option>\n {stacks.map((option) => <option value={option.id}>{option.label}</option>)}\n </select>\n </label>\n )}\n </div>\n )}\n\n {fields.platforms && (\n <fieldset class=\"m-0 grid gap-2 border-0 p-0\">\n <legend class={`${labelText} mb-2`}>Platforms</legend>\n <div class=\"flex flex-wrap gap-2\">\n {platformOptions.map((platform) => (\n <label class=\"inline-flex min-h-9 cursor-pointer items-center gap-2 rounded-full border border-border px-3 text-sm text-foreground has-[:checked]:border-foreground has-[:checked]:bg-foreground has-[:checked]:text-background\">\n <input type=\"checkbox\" name=\"platform\" value={platform.id} class=\"sr-only\" />\n <span>{platform.label}</span>\n </label>\n ))}\n </div>\n </fieldset>\n )}\n\n\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Your GitHub username <span class=\"font-normal text-muted-foreground\">(recommended)</span></span>\n <div class=\"flex items-center gap-2\">\n <span class=\"text-sm text-muted-foreground\">@</span>\n <input id=\"submitted-by\" type=\"text\" autocomplete=\"username\" spellcheck=\"false\" placeholder=\"octocat\" class={`${control} max-w-xs`} />\n </div>\n <span class={hint}>Shown as “Submitted by @you” on the page and on the contributors page.</span>\n </label>\n\n <details class=\"group rounded-[var(--radius)] border border-border bg-background\">\n <summary class=\"flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-sm font-medium text-foreground [&::-webkit-details-marker]:hidden\">\n <span>Add more detail <span class=\"font-normal text-muted-foreground\">— optional: tags, licence, website, who it is for</span></span>\n <span aria-hidden=\"true\" class=\"text-muted-foreground transition-transform group-open:rotate-45\">+</span>\n </summary>\n <div class=\"grid gap-5 border-t border-border px-4 pb-5 pt-4\">\n {fields.tags && (\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Tags</span>\n <input id=\"item-tags\" type=\"text\" placeholder=\"self-hosted, developer-tools, offline-first\" class={control} />\n <span class={hint}>Comma-separated. Pre-filled from the repository topics.</span>\n </label>\n )}\n <div class=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n {fields.license && licenseOptions.length > 0 && (\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Licence</span>\n <select id=\"item-license\" class={control}>\n <option value=\"\">Detected from the repository</option>\n {licenseOptions.map((option) => <option value={option.id}>{option.label}</option>)}\n </select>\n </label>\n )}\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Website</span>\n <input id=\"item-website\" type=\"url\" placeholder=\"https://example.com\" class={control} />\n </label>\n </div>\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Best for</span>\n <textarea id=\"best-for\" rows=\"2\" class={`${control} resize-y`} placeholder=\"One use case per line\"></textarea>\n <span class={hint}>Who it suits — one audience or use case per line.</span>\n </label>\n </div>\n </details>\n </div>\n </section>\n </form>\n\n {/* ── 3. Review & open the pull request ─────────── */}\n <aside class=\"flex flex-col gap-4 lg:sticky lg:top-20\" aria-labelledby=\"step-review\">\n <section class=\"rounded-[var(--radius-lg)] border border-border bg-card p-5\">\n <h2 id=\"step-review\" class=\"m-0 flex items-center gap-2 text-[1.0625rem] font-semibold text-foreground\">\n <span class=\"text-muted-foreground\">3.</span> Preview and open the PR\n </h2>\n\n <div id=\"preview-card\" class=\"mt-4 rounded-[var(--radius)] border border-border bg-background p-4\">\n <div class=\"flex items-start gap-3\">\n <img id=\"preview-avatar\" hidden src=\"data:,\" alt=\"\" width=\"40\" height=\"40\" class=\"h-10 w-10 shrink-0 rounded-lg border border-border object-cover\" />\n <span id=\"preview-initials\" class=\"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border border-dashed border-border text-sm font-semibold text-muted-foreground\">?</span>\n <div class=\"min-w-0\">\n <p id=\"preview-name\" class=\"m-0 truncate text-[0.9375rem] font-semibold text-foreground\">{`Your ${singular}`}</p>\n <p id=\"preview-meta\" class=\"m-0 mt-0.5 text-2xs text-muted-foreground\">Category · Stack</p>\n </div>\n </div>\n <p id=\"preview-description\" class=\"m-0 mt-3 line-clamp-3 text-sm leading-relaxed text-muted-foreground\">The description appears here.</p>\n <p id=\"preview-credit\" hidden class=\"m-0 mt-3 text-2xs text-muted-foreground\"></p>\n </div>\n\n <ul id=\"submit-checklist\" class=\"m-0 mt-4 flex list-none flex-col gap-1.5 p-0 text-sm\" aria-label=\"Before you open the pull request\">\n {[\n [\"repo\", \"Repository fetched\"],\n [\"description\", \"Description of 40+ characters\"],\n ...(fields.category ? [[\"category\", \"Category chosen\"]] : []),\n ...(fields.stack ? [[\"stack\", \"Primary stack chosen\"]] : []),\n ...(fields.platforms ? [[\"platforms\", \"At least one platform\"]] : []),\n [\"credit\", \"Your GitHub username (optional)\"],\n ].map(([key, label]) => (\n <li data-check={key} data-ok=\"false\" class=\"group flex items-center gap-2 text-muted-foreground data-[ok=true]:text-foreground\">\n <span class=\"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-border group-data-[ok=true]:border-success group-data-[ok=true]:bg-success group-data-[ok=true]:text-background\">\n <svg viewBox=\"0 0 16 16\" width=\"9\" height=\"9\" aria-hidden=\"true\" fill=\"currentColor\" class=\"hidden group-data-[ok=true]:block\"><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\" /></svg>\n </span>\n {label}\n </li>\n ))}\n </ul>\n\n <div class=\"mt-5 grid gap-2\">\n <a id=\"open-pr-link\" href=\"#\" target=\"_blank\" rel=\"noopener\" class={buttonClass(\"primary\", \"md\", \"w-full justify-center pointer-events-none opacity-50\")}>\n Open pull request on GitHub\n </a>\n <button id=\"copy-yaml\" type=\"button\" disabled class={buttonClass(\"ghost\", \"sm\", \"w-full justify-center pointer-events-none opacity-50\")}>Copy the file instead</button>\n </div>\n <p id=\"submit-status\" class=\"m-0 mt-3 min-h-5 text-2xs text-muted-foreground\" aria-live=\"polite\"></p>\n\n <details class=\"group mt-2 border-t border-border pt-3\">\n <summary class=\"flex cursor-pointer list-none items-center justify-between text-2xs font-medium text-muted-foreground hover:text-foreground [&::-webkit-details-marker]:hidden\">\n <span>Show the file <span id=\"record-path\" class=\"font-mono\"></span></span>\n <span aria-hidden=\"true\" class=\"transition-transform group-open:rotate-45\">+</span>\n </summary>\n <pre class=\"mt-3 max-h-96 overflow-auto rounded-md border border-border bg-surface-sunken p-3 text-xs leading-relaxed text-foreground\"><code id=\"yaml-preview\">Paste a GitHub URL to generate a draft.</code></pre>\n </details>\n </section>\n\n <section class=\"rounded-[var(--radius-lg)] border border-border bg-card p-5\">\n <h2 class=\"m-0 text-sm font-semibold text-foreground\">What happens next</h2>\n <ol class=\"m-0 mt-3 flex list-none flex-col gap-3 p-0 text-2xs leading-relaxed text-muted-foreground\">\n {[\n [\"GitHub opens with the file ready.\", \"Commit it to a fork and open the pull request — one record file.\"],\n [\"Checks run on the pull request.\", \"Schema, taxonomy and duplicate checks — fix anything they flag.\"],\n [\"A maintainer reviews and merges.\", \"Curation and review fields are theirs to fill.\"],\n [\"The page goes live and credits you.\", \"It shows “Submitted by @you”, and maintainers get a README badge.\"],\n ].map(([head, text], i) => (\n <li class=\"flex gap-3\">\n <span class=\"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-secondary text-[10px] font-semibold text-secondary-foreground\">{i + 1}</span>\n <span><strong class=\"font-semibold text-foreground\">{head}</strong> {text}</span>\n </li>\n ))}\n </ol>\n </section>\n\n <details class=\"group rounded-[var(--radius-lg)] border border-border bg-card\">\n <summary class=\"flex cursor-pointer list-none items-center justify-between px-5 py-4 text-sm font-semibold text-foreground [&::-webkit-details-marker]:hidden\">\n Is it a good fit?\n <span aria-hidden=\"true\" class=\"text-muted-foreground transition-transform group-open:rotate-45\">+</span>\n </summary>\n <div class=\"grid gap-4 border-t border-border px-5 pb-5 pt-4 text-2xs sm:grid-cols-2 lg:grid-cols-1\">\n <div>\n <p class=\"m-0 font-semibold uppercase tracking-wider text-emerald-700 dark:text-emerald-400\">Good fit</p>\n <ul class=\"m-0 mt-2 list-none space-y-1.5 p-0 text-foreground\">\n {goodSubmissions.map((item) => <li class=\"flex gap-2\"><span class=\"text-success\">✓</span><span>{item}</span></li>)}\n </ul>\n </div>\n <div>\n <p class=\"m-0 font-semibold uppercase tracking-wider text-amber-700 dark:text-amber-400\">Not a fit</p>\n <ul class=\"m-0 mt-2 list-none space-y-1.5 p-0 text-foreground\">\n {pleaseAvoid.map((item) => <li class=\"flex gap-2\"><span class=\"text-warning\">×</span><span>{item}</span></li>)}\n </ul>\n </div>\n </div>\n </details>\n </aside>\n </div>\n </Container>\n\n <SubmissionClient\n existingSlugs={existingSlugs}\n existingFullNames={existingFullNames}\n repoUrl={repoUrl}\n fields={fields}\n taxonomy={taxonomy}\n categoryLabels={Object.fromEntries(categories.map((c) => [c.id, c.label]))}\n stackLabels={Object.fromEntries(stacks.map((c) => [c.id, c.label]))}\n />\n</BaseLayout>\n",
465
+ "content": "---\nimport siteConfig from '@grove/generated/site-config.json';\nimport { getSubmissionPageModel } from '@grove-dev/astro/server';\nimport SubmissionClient from '../components/grove/submission-client.astro';\nimport BaseLayout from '../layouts/base-layout.astro';\nimport Container from '../layouts/container.astro';\nimport { buttonClass } from '../lib/classnames.ts';\n\nconst {\n singular,\n title,\n description,\n repoUrl,\n copy,\n fields,\n categories,\n stacks,\n existingSlugs,\n existingFullNames,\n platformOptions,\n licenseOptions,\n taxonomy,\n} = getSubmissionPageModel(siteConfig);\nconst goodSubmissions = [\n ...(copy.good?.length\n ? copy.good\n : [\n `A real, usable ${singular}, not a tutorial or one-screen demo`,\n 'A public repository with a clear open-source license',\n 'Enough documentation to understand, run, or contribute',\n 'Recent maintenance, releases, or meaningful project history',\n ]),\n];\nconst pleaseAvoid = [\n ...(copy.avoid?.length\n ? copy.avoid\n : [\n 'Snippets, exercises, abandoned experiments, or duplicate entries',\n 'Private repositories or projects without source',\n 'Marketing pages with no usable project behind them',\n 'Records with no license or verifiable repository',\n ]),\n];\n\n// Shared control styling.\nconst control =\n 'min-h-10 w-full rounded-[var(--radius)] border border-input bg-background px-3 py-2 text-sm text-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/35';\nconst labelText = 'text-sm font-medium text-foreground';\nconst hint = 'text-2xs leading-relaxed text-muted-foreground';\nconst steps = [\n { id: 'repo', title: 'Repository', text: 'Paste the GitHub URL' },\n { id: 'details', title: 'Details', text: 'Say what it is and who it is for' },\n { id: 'review', title: 'Open the pull request', text: 'Check the preview, open one PR' },\n];\n---\n\n<BaseLayout\n title={title}\n description={description}\n noindex\n site={siteConfig}\n submitHref=\"/submit/\"\n>\n <div class=\"border-b border-border bg-surface-sunken/60\">\n <Container>\n <section class=\"py-10 sm:py-14\">\n <p class=\"m-0 text-2xs font-semibold uppercase tracking-wider text-muted-foreground\">\n {copy.eyebrow ?? `${singular} submission`}\n </p>\n <h1 class=\"m-0 mt-2 text-[2rem] font-semibold leading-tight tracking-tight text-foreground sm:text-[2.5rem]\">\n {copy.title ?? `Add ${singular === \"app\" ? \"an\" : \"a\"} ${singular} to the directory`}\n </h1>\n <p class=\"m-0 mt-3 max-w-[62ch] text-[1rem] leading-relaxed text-muted-foreground\">\n {copy.description ?? description}\n </p>\n <ul class=\"m-0 mt-5 flex list-none flex-wrap gap-2 p-0 text-2xs\">\n {[\"No account on this site\", \"Reviewed by a person\", \"Credited on the page\", \"README badge for maintainers\"].map((item) => (\n <li class=\"inline-flex items-center gap-1.5 rounded-full border border-border bg-background px-2.5 py-1 font-medium text-foreground\">\n <svg viewBox=\"0 0 16 16\" width=\"11\" height=\"11\" aria-hidden=\"true\" fill=\"currentColor\" class=\"text-success\"><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\" /></svg>\n {item}\n </li>\n ))}\n </ul>\n\n <ol id=\"submit-steps\" class=\"m-0 mt-8 grid list-none grid-cols-1 gap-2 p-0 sm:grid-cols-3\" aria-label=\"Submission steps\">\n {steps.map((step, i) => (\n <li data-step={step.id} data-state={i === 0 ? \"current\" : \"todo\"} class=\"group flex items-center gap-3 rounded-[var(--radius-lg)] border border-border bg-background px-3 py-2.5 data-[state=current]:border-foreground data-[state=done]:border-success/50\">\n <span class=\"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-border text-xs font-semibold tabular-nums text-muted-foreground group-data-[state=current]:border-foreground group-data-[state=current]:bg-foreground group-data-[state=current]:text-background group-data-[state=done]:border-success group-data-[state=done]:bg-success group-data-[state=done]:text-background\">\n <span class=\"group-data-[state=done]:hidden\">{i + 1}</span>\n <svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" aria-hidden=\"true\" fill=\"currentColor\" class=\"hidden group-data-[state=done]:block\"><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\" /></svg>\n </span>\n <span class=\"min-w-0\">\n <span class=\"block text-sm font-semibold text-foreground\">{step.title}</span>\n <span class=\"block truncate text-2xs text-muted-foreground\">{step.text}</span>\n </span>\n </li>\n ))}\n </ol>\n </section>\n </Container>\n </div>\n\n <Container>\n <div class=\"grid grid-cols-1 items-start gap-6 py-8 sm:py-10 lg:grid-cols-[minmax(0,1fr)_minmax(320px,0.8fr)]\">\n <form id=\"submit-form\" class=\"grid gap-6\" novalidate>\n {/* ── 1. Repository ───────────────────────────── */}\n <section aria-labelledby=\"step-repo\" class=\"rounded-[var(--radius-lg)] border border-border bg-card p-5 sm:p-6\">\n <h2 id=\"step-repo\" class=\"m-0 flex items-center gap-2 text-[1.0625rem] font-semibold text-foreground\">\n <span class=\"text-muted-foreground\">1.</span> Repository\n </h2>\n <label class=\"mt-4 grid gap-1.5\">\n <span class={labelText}>GitHub URL</span>\n <div class=\"flex flex-col gap-2 sm:flex-row\">\n <input id=\"repo-url\" type=\"url\" required autocomplete=\"off\" placeholder=\"https://github.com/owner/repo\" class={`${control} min-h-11 text-[0.9375rem] sm:flex-1`} />\n <button id=\"fetch-repo\" type=\"button\" class={buttonClass(\"primary\", \"bare\", \"min-h-11 whitespace-nowrap px-4 text-sm\")}>Fetch details</button>\n </div>\n <span class={hint}>Public repositories only. We read it from the GitHub API and never write to it.</span>\n </label>\n <div id=\"repo-card\" hidden class=\"mt-4 flex items-start gap-3 rounded-[var(--radius)] border border-border bg-background p-3\">\n <img id=\"repo-avatar\" src=\"data:,\" alt=\"\" width=\"40\" height=\"40\" class=\"h-10 w-10 shrink-0 rounded-lg border border-border object-cover\" />\n <div class=\"min-w-0 flex-1\">\n <p id=\"repo-name\" class=\"m-0 truncate text-sm font-semibold text-foreground\"></p>\n <p id=\"repo-description\" class=\"m-0 mt-0.5 line-clamp-2 text-2xs text-muted-foreground\"></p>\n <p id=\"repo-facts\" class=\"m-0 mt-1.5 flex flex-wrap gap-x-3 text-2xs text-muted-foreground\"></p>\n </div>\n </div>\n </section>\n\n {/* ── 2. Details ──────────────────────────────── */}\n <section aria-labelledby=\"step-details\" class=\"rounded-[var(--radius-lg)] border border-border bg-card p-5 sm:p-6\">\n <h2 id=\"step-details\" class=\"m-0 flex items-center gap-2 text-[1.0625rem] font-semibold text-foreground\">\n <span class=\"text-muted-foreground\">2.</span> About the {singular}\n </h2>\n <p class=\"m-0 mt-1 text-2xs text-muted-foreground\">Filled from GitHub where possible — edit anything that reads like a README.</p>\n\n <div class=\"mt-5 grid gap-5\">\n <div class=\"grid grid-cols-1 items-start gap-4 sm:grid-cols-[minmax(0,1fr)_14rem]\">\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Name</span>\n <input id=\"item-name\" type=\"text\" class={control} />\n </label>\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Page address</span>\n <input id=\"item-slug\" type=\"text\" class={`${control} font-mono`} />\n <span class={hint}>The last part of the page URL — from the repo name.</span>\n </label>\n </div>\n\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Description</span>\n <textarea id=\"item-description\" rows=\"3\" class={`${control} resize-y`}></textarea>\n <span class={hint}>One or two plain sentences: what it is and who it is for. At least 40 characters.</span>\n </label>\n\n {(fields.category || fields.stack) && (\n <div class:list={[\"grid grid-cols-1 gap-4\", fields.category && fields.stack && \"sm:grid-cols-2\"]}>\n {fields.category && (\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Category</span>\n <select id=\"item-category\" class={control}>\n <option value=\"\">Choose a category</option>\n {categories.map((option) => <option value={option.id}>{option.label}</option>)}\n </select>\n </label>\n )}\n {fields.stack && (\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Primary stack</span>\n <select id=\"primary-stack\" class={control}>\n <option value=\"\">Choose a stack</option>\n {stacks.map((option) => <option value={option.id}>{option.label}</option>)}\n </select>\n </label>\n )}\n </div>\n )}\n\n {fields.platforms && (\n <fieldset class=\"m-0 grid gap-2 border-0 p-0\">\n <legend class={`${labelText} mb-2`}>Platforms</legend>\n <div class=\"flex flex-wrap gap-2\">\n {platformOptions.map((platform) => (\n <label class=\"inline-flex min-h-9 cursor-pointer items-center gap-2 rounded-full border border-border px-3 text-sm text-foreground has-[:checked]:border-foreground has-[:checked]:bg-foreground has-[:checked]:text-background\">\n <input type=\"checkbox\" name=\"platform\" value={platform.id} class=\"sr-only\" />\n <span>{platform.label}</span>\n </label>\n ))}\n </div>\n </fieldset>\n )}\n\n\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Your GitHub username <span class=\"font-normal text-muted-foreground\">(recommended)</span></span>\n <div class=\"flex items-center gap-2\">\n <span class=\"text-sm text-muted-foreground\">@</span>\n <input id=\"submitted-by\" type=\"text\" autocomplete=\"username\" spellcheck=\"false\" placeholder=\"octocat\" class={`${control} max-w-xs`} />\n </div>\n <span class={hint}>Shown as “Submitted by @you” on the page and on the contributors page.</span>\n </label>\n\n <details class=\"group rounded-[var(--radius)] border border-border bg-background\">\n <summary class=\"flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-sm font-medium text-foreground [&::-webkit-details-marker]:hidden\">\n <span>Add more detail <span class=\"font-normal text-muted-foreground\">— optional: tags, licence, website, who it is for</span></span>\n <span aria-hidden=\"true\" class=\"text-muted-foreground transition-transform group-open:rotate-45\">+</span>\n </summary>\n <div class=\"grid gap-5 border-t border-border px-4 pb-5 pt-4\">\n {fields.tags && (\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Tags</span>\n <input id=\"item-tags\" type=\"text\" placeholder=\"self-hosted, developer-tools, offline-first\" class={control} />\n <span class={hint}>Comma-separated. Pre-filled from the repository topics.</span>\n </label>\n )}\n <div class=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n {fields.license && licenseOptions.length > 0 && (\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Licence</span>\n <select id=\"item-license\" class={control}>\n <option value=\"\">Detected from the repository</option>\n {licenseOptions.map((option) => <option value={option.id}>{option.label}</option>)}\n </select>\n </label>\n )}\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Website</span>\n <input id=\"item-website\" type=\"url\" placeholder=\"https://example.com\" class={control} />\n </label>\n </div>\n <label class=\"grid gap-1.5\">\n <span class={labelText}>Best for</span>\n <textarea id=\"best-for\" rows=\"2\" class={`${control} resize-y`} placeholder=\"One use case per line\"></textarea>\n <span class={hint}>Who it suits — one audience or use case per line.</span>\n </label>\n </div>\n </details>\n </div>\n </section>\n </form>\n\n {/* ── 3. Review & open the pull request ─────────── */}\n <aside class=\"flex flex-col gap-4 lg:sticky lg:top-20\" aria-labelledby=\"step-review\">\n <section class=\"rounded-[var(--radius-lg)] border border-border bg-card p-5\">\n <h2 id=\"step-review\" class=\"m-0 flex items-center gap-2 text-[1.0625rem] font-semibold text-foreground\">\n <span class=\"text-muted-foreground\">3.</span> Preview and open the PR\n </h2>\n\n <div id=\"preview-card\" class=\"mt-4 rounded-[var(--radius)] border border-border bg-background p-4\">\n <div class=\"flex items-start gap-3\">\n <img id=\"preview-avatar\" hidden src=\"data:,\" alt=\"\" width=\"40\" height=\"40\" class=\"h-10 w-10 shrink-0 rounded-lg border border-border object-cover\" />\n <span id=\"preview-initials\" class=\"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border border-dashed border-border text-sm font-semibold text-muted-foreground\">?</span>\n <div class=\"min-w-0\">\n <p id=\"preview-name\" class=\"m-0 truncate text-[0.9375rem] font-semibold text-foreground\">{`Your ${singular}`}</p>\n <p id=\"preview-meta\" class=\"m-0 mt-0.5 text-2xs text-muted-foreground\">Category · Stack</p>\n </div>\n </div>\n <p id=\"preview-description\" class=\"m-0 mt-3 line-clamp-3 text-sm leading-relaxed text-muted-foreground\">The description appears here.</p>\n <p id=\"preview-credit\" hidden class=\"m-0 mt-3 text-2xs text-muted-foreground\"></p>\n </div>\n\n <ul id=\"submit-checklist\" class=\"m-0 mt-4 flex list-none flex-col gap-1.5 p-0 text-sm\" aria-label=\"Before you open the pull request\">\n {[\n [\"repo\", \"Repository fetched\"],\n [\"description\", \"Description of 40+ characters\"],\n ...(fields.category ? [[\"category\", \"Category chosen\"]] : []),\n ...(fields.stack ? [[\"stack\", \"Primary stack chosen\"]] : []),\n ...(fields.platforms ? [[\"platforms\", \"At least one platform\"]] : []),\n [\"credit\", \"Your GitHub username (optional)\"],\n ].map(([key, label]) => (\n <li data-check={key} data-ok=\"false\" class=\"group flex items-center gap-2 text-muted-foreground data-[ok=true]:text-foreground\">\n <span class=\"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-border group-data-[ok=true]:border-success group-data-[ok=true]:bg-success group-data-[ok=true]:text-background\">\n <svg viewBox=\"0 0 16 16\" width=\"9\" height=\"9\" aria-hidden=\"true\" fill=\"currentColor\" class=\"hidden group-data-[ok=true]:block\"><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\" /></svg>\n </span>\n {label}\n </li>\n ))}\n </ul>\n\n <div class=\"mt-5 grid gap-2\">\n <a id=\"open-pr-link\" href=\"#\" target=\"_blank\" rel=\"noopener\" class={buttonClass(\"primary\", \"md\", \"w-full justify-center pointer-events-none opacity-50\")}>\n Open pull request on GitHub\n </a>\n <button id=\"copy-yaml\" type=\"button\" disabled class={buttonClass(\"ghost\", \"sm\", \"w-full justify-center pointer-events-none opacity-50\")}>Copy the file instead</button>\n </div>\n <p id=\"submit-status\" class=\"m-0 mt-3 min-h-5 text-2xs text-muted-foreground\" aria-live=\"polite\"></p>\n\n <details class=\"group mt-2 border-t border-border pt-3\">\n <summary class=\"flex cursor-pointer list-none items-center justify-between text-2xs font-medium text-muted-foreground hover:text-foreground [&::-webkit-details-marker]:hidden\">\n <span>Show the file <span id=\"record-path\" class=\"font-mono\"></span></span>\n <span aria-hidden=\"true\" class=\"transition-transform group-open:rotate-45\">+</span>\n </summary>\n <pre class=\"mt-3 max-h-96 overflow-auto rounded-md border border-border bg-surface-sunken p-3 text-xs leading-relaxed text-foreground\"><code id=\"yaml-preview\">Paste a GitHub URL to generate a draft.</code></pre>\n </details>\n </section>\n\n <section class=\"rounded-[var(--radius-lg)] border border-border bg-card p-5\">\n <h2 class=\"m-0 text-sm font-semibold text-foreground\">What happens next</h2>\n <ol class=\"m-0 mt-3 flex list-none flex-col gap-3 p-0 text-2xs leading-relaxed text-muted-foreground\">\n {[\n [\"GitHub opens with the file ready.\", \"Commit it to a fork and open the pull request — one record file.\"],\n [\"Checks run on the pull request.\", \"Schema, taxonomy and duplicate checks — fix anything they flag.\"],\n [\"A maintainer reviews and merges.\", \"Curation and review fields are theirs to fill.\"],\n [\"The page goes live and credits you.\", \"It shows “Submitted by @you”, and maintainers get a README badge.\"],\n ].map(([head, text], i) => (\n <li class=\"flex gap-3\">\n <span class=\"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-secondary text-[10px] font-semibold text-secondary-foreground\">{i + 1}</span>\n <span><strong class=\"font-semibold text-foreground\">{head}</strong> {text}</span>\n </li>\n ))}\n </ol>\n </section>\n\n <details class=\"group rounded-[var(--radius-lg)] border border-border bg-card\">\n <summary class=\"flex cursor-pointer list-none items-center justify-between px-5 py-4 text-sm font-semibold text-foreground [&::-webkit-details-marker]:hidden\">\n Is it a good fit?\n <span aria-hidden=\"true\" class=\"text-muted-foreground transition-transform group-open:rotate-45\">+</span>\n </summary>\n <div class=\"grid gap-4 border-t border-border px-5 pb-5 pt-4 text-2xs sm:grid-cols-2 lg:grid-cols-1\">\n <div>\n <p class=\"m-0 font-semibold uppercase tracking-wider text-emerald-700 dark:text-emerald-400\">Good fit</p>\n <ul class=\"m-0 mt-2 list-none space-y-1.5 p-0 text-foreground\">\n {goodSubmissions.map((item) => <li class=\"flex gap-2\"><span class=\"text-success\">✓</span><span>{item}</span></li>)}\n </ul>\n </div>\n <div>\n <p class=\"m-0 font-semibold uppercase tracking-wider text-amber-700 dark:text-amber-400\">Not a fit</p>\n <ul class=\"m-0 mt-2 list-none space-y-1.5 p-0 text-foreground\">\n {pleaseAvoid.map((item) => <li class=\"flex gap-2\"><span class=\"text-warning\">×</span><span>{item}</span></li>)}\n </ul>\n </div>\n </div>\n </details>\n </aside>\n </div>\n </Container>\n\n <SubmissionClient\n existingSlugs={existingSlugs}\n existingFullNames={existingFullNames}\n repoUrl={repoUrl}\n fields={fields}\n taxonomy={taxonomy}\n categoryLabels={Object.fromEntries(categories.map((c) => [c.id, c.label]))}\n stackLabels={Object.fromEntries(stacks.map((c) => [c.id, c.label]))}\n />\n</BaseLayout>\n",
466
466
  "type": "registry:page",
467
467
  "target": "~/src/pages/submit.astro"
468
468
  },
@@ -474,7 +474,7 @@
474
474
  },
475
475
  {
476
476
  "path": "default/pages/about.astro",
477
- "content": "---\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getAboutPageSeo,\n getPageContentHtml,\n indexSlug,\n itemLabel,\n itemLabelPlural,\n} from '@grove-dev/astro/server';\n/**\n * About page — generic.\n *\n * A continuous narrative in three movements: what this site is →\n * how it's built (the file-first pipeline: source files → Grove →\n * multiple outputs → ongoing sync) → how to contribute. Prose\n * sections, not a stack of cards — the reading experience is the\n * point here.\n *\n * The copy is generic — references \"directory\", \"record\",\n * \"repository\" — so it works for any blueprint, and every dynamic\n * value (`siteConfig.tagline`, `siteConfig.repoUrl`, item labels)\n * flows from the site config.\n */\nimport BaseLayout from '../layouts/base-layout.astro';\nimport Container from '../layouts/container.astro';\nimport { buttonClass } from '../lib/classnames.ts';\n\ntype Press = { outlet: string; title: string; url: string; date: string; logo?: string };\nconst press = (siteConfig as { press?: Press[] }).press ?? [];\n\nconst githubUrl = siteConfig.repoUrl;\nconst seo = getAboutPageSeo(siteConfig);\nconst slug = indexSlug();\nconst item = itemLabel();\nconst items = itemLabelPlural();\nconst pageContentHtml = getPageContentHtml('about');\n---\n\n<BaseLayout title={seo.title} description={seo.description} image={seo.image} jsonLd={seo.jsonLd} site={siteConfig}>\n <Container size=\"narrow\">\n <article class=\"py-12 sm:py-16\">\n <nav class=\"text-2xs text-muted-foreground\" aria-label=\"Breadcrumb\">\n <a href=\"/\" class=\"hover:text-foreground\">Home</a>\n <span class=\"mx-1.5 text-ink-300 dark:text-ink-700\">/</span>\n <span class=\"text-foreground\">About</span>\n </nav>\n\n {pageContentHtml ? (\n <section class=\"grove-prose mt-8\" set:html={pageContentHtml} />\n ) : (\n <>\n <header class=\"mt-5\">\n <span class=\"text-2xs font-medium uppercase tracking-wider text-muted-foreground\">\n About\n </span>\n <h1 class=\"mt-1 m-0 text-[1.75rem] sm:text-[2.25rem] font-semibold tracking-[-0.02em] leading-[1.1] text-foreground\">\n A directory that lives in files.\n </h1>\n <p class=\"mt-4 m-0 text-[1rem] sm:text-[1.0625rem] leading-relaxed text-foreground max-w-[62ch]\">\n {siteConfig.name} is a curated, health-aware directory of open-source\n {items} — and every listing you see here is a plain YAML file in a\n public repository. This website is one of the outputs generated from\n those files.\n </p>\n </header>\n\n <section class=\"mt-10\">\n <h2 class=\"m-0 text-[1.25rem] sm:text-[1.375rem] font-semibold tracking-tight text-foreground\">\n Why it exists\n </h2>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n GitHub search and README lists optimize for the repository name and\n description. They rarely tell you whether a project is a real {item}\n or a demo, which stack it uses beyond the headline, how active it\n really is, or whether it has a clear license.\n </p>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n Each entry here carries the metadata a developer actually needs\n before opening the repo: stack, platforms, license, activity and\n health signals, plus curated notes — best for, why listed, caveats.\n Everything links back to real, runnable source. No SEO spam, no\n affiliate farms, no broken links.\n </p>\n </section>\n\n <section class=\"mt-10\">\n <h2 class=\"m-0 text-[1.25rem] sm:text-[1.375rem] font-semibold tracking-tight text-foreground\">\n How it's built\n </h2>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n The source of truth is a folder of files: one YAML record per\n {item}, taxonomy files for categories, stacks, platforms, and\n licenses, and Markdown for long-form notes. <a href=\"https://github.com/tortuvshin/grove\" class=\"font-medium underline decoration-border underline-offset-2 hover:decoration-ring\">Grove</a> validates\n those files, joins in synced GitHub metadata, and publishes them as\n multiple outputs — this website with its search and filters, a\n generated README, an <code class=\"font-mono text-[0.875em]\">llms.txt</code> index\n for machines, and sitemap/SEO data.\n </p>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n Automation keeps the outputs current: weekly syncs refresh stars,\n activity, and contributor data, and every change to a source file\n rebuilds everything derived from it. There is no database and no\n server — the output is static HTML, and the content stays portable\n in files you can fork.\n </p>\n </section>\n\n <section class=\"mt-10\">\n <h2 class=\"m-0 text-[1.25rem] sm:text-[1.375rem] font-semibold tracking-tight text-foreground\">\n How to contribute\n </h2>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n Because the content is files, contributing is a pull request: add a\n YAML record for a new {item}, fix a typo, or improve the metadata\n behind an existing listing. The <a href=\"/submit\" class=\"font-medium underline decoration-border underline-offset-2 hover:decoration-ring\">submit page</a> drafts\n the YAML for you from a repository URL, and every submission is\n reviewed against the curation bar before it lands.\n </p>\n </section>\n\n <section class=\"mt-10 flex flex-wrap items-center gap-3\">\n <a href={`/${slug}/`} class={buttonClass(\"primary\", \"sm\")}>Browse the directory</a>\n {githubUrl && (\n <a\n href={githubUrl}\n target=\"_blank\"\n rel=\"noopener\"\n class={buttonClass(\"secondary\", \"sm\")}\n >\n View on GitHub\n </a>\n )}\n <a href=\"/submit\" class={buttonClass(\"ghost\", \"sm\")}>Submit a {item} →</a>\n </section>\n </>\n )}\n {press.length > 0 && (\n <section class=\"mt-12 border-t border-border pt-8\" aria-labelledby=\"press-heading\">\n <h2 id=\"press-heading\" class=\"m-0 text-[1.25rem] font-semibold tracking-tight text-foreground\">Featured in</h2>\n <ul class=\"m-0 mt-4 flex list-none flex-col gap-2 p-0\">\n {press.map((item) => (\n <li class=\"m-0\">\n <a href={item.url} target=\"_blank\" rel=\"noopener\" class=\"flex items-center gap-3 rounded-[var(--radius-lg)] border border-border bg-card p-3 no-underline hover:border-ink-400 dark:hover:border-ink-600\">\n {item.logo && (\n <span class=\"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-white p-1.5\"><img src={item.logo} alt=\"\" width=\"20\" height=\"20\" class=\"h-5 w-5\" /></span>\n )}\n <span class=\"min-w-0\">\n <span class=\"block text-sm font-semibold text-foreground\">{item.title}</span>\n <span class=\"block text-2xs text-muted-foreground\">{item.outlet} · {new Date(`${item.date}-01T00:00:00Z`).toLocaleDateString('en-US', { month: 'long', year: 'numeric', timeZone: 'UTC' })}</span>\n </span>\n </a>\n </li>\n ))}\n </ul>\n </section>\n )}\n </article>\n </Container>\n</BaseLayout>\n",
477
+ "content": "---\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getAboutPageSeo,\n getPageContentHtml,\n indexSlug,\n itemLabel,\n itemLabelPlural,\n} from '@grove-dev/astro/server';\n/**\n * About page — generic.\n *\n * A continuous narrative in three movements: what this site is →\n * how it's built (the file-first pipeline: source files → Grove →\n * multiple outputs → ongoing sync) → how to contribute. Prose\n * sections, not a stack of cards — the reading experience is the\n * point here.\n *\n * The copy is generic — references \"directory\", \"record\",\n * \"repository\" — so it works for any blueprint, and every dynamic\n * value (`siteConfig.tagline`, `siteConfig.repoUrl`, item labels)\n * flows from the site config.\n */\nimport BaseLayout from '../layouts/base-layout.astro';\nimport Container from '../layouts/container.astro';\nimport { buttonClass } from '../lib/classnames.ts';\n\ntype Press = { outlet: string; title: string; url: string; date: string; logo?: string };\nconst press = (siteConfig as { press?: Press[] }).press ?? [];\n\nconst githubUrl = siteConfig.repoUrl;\nconst seo = getAboutPageSeo(siteConfig);\nconst slug = indexSlug();\nconst item = itemLabel();\nconst items = itemLabelPlural();\nconst pageContentHtml = getPageContentHtml('about');\n---\n\n<BaseLayout title={seo.title} description={seo.description} image={seo.image} jsonLd={seo.jsonLd} site={siteConfig}>\n <Container size=\"narrow\">\n <article class=\"py-12 sm:py-16\">\n <nav class=\"text-2xs text-muted-foreground\" aria-label=\"Breadcrumb\">\n <a href=\"/\" class=\"hover:text-foreground\">Home</a>\n <span class=\"mx-1.5 text-ink-300 dark:text-ink-700\">/</span>\n <span class=\"text-foreground\">About</span>\n </nav>\n\n {pageContentHtml ? (\n <section class=\"grove-prose mt-8\" set:html={pageContentHtml} />\n ) : (\n <>\n <header class=\"mt-5\">\n <span class=\"text-2xs font-medium uppercase tracking-wider text-muted-foreground\">\n About\n </span>\n <h1 class=\"mt-1 m-0 text-[1.75rem] sm:text-[2.25rem] font-semibold tracking-[-0.02em] leading-[1.1] text-foreground\">\n A directory that lives in files.\n </h1>\n <p class=\"mt-4 m-0 text-[1rem] sm:text-[1.0625rem] leading-relaxed text-foreground max-w-[62ch]\">\n {siteConfig.name} is a curated, health-aware directory of open-source\n {items} — and every listing you see here is a plain YAML file in a\n public repository. This website is one of the outputs generated from\n those files.\n </p>\n </header>\n\n <section class=\"mt-10\">\n <h2 class=\"m-0 text-[1.25rem] sm:text-[1.375rem] font-semibold tracking-tight text-foreground\">\n Why it exists\n </h2>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n GitHub search and README lists optimize for the repository name and\n description. They rarely tell you whether a project is a real {item}\n or a demo, which stack it uses beyond the headline, how active it\n really is, or whether it has a clear license.\n </p>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n Each entry here carries the metadata a developer actually needs\n before opening the repo: stack, platforms, license, activity and\n health signals, plus curated notes — best for, why listed, caveats.\n Everything links back to real, runnable source. No SEO spam, no\n affiliate farms, no broken links.\n </p>\n </section>\n\n <section class=\"mt-10\">\n <h2 class=\"m-0 text-[1.25rem] sm:text-[1.375rem] font-semibold tracking-tight text-foreground\">\n How it's built\n </h2>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n The source of truth is a folder of files: one YAML record per\n {item}, taxonomy files for categories, stacks, platforms, and\n licenses, and Markdown for long-form notes. <a href=\"https://github.com/tortuvshin/grove\" class=\"font-medium underline decoration-border underline-offset-2 hover:decoration-ring\">Grove</a> validates\n those files, joins in synced GitHub metadata, and publishes them as\n multiple outputs — this website with its search and filters, a\n generated README, an <code class=\"font-mono text-[0.875em]\">llms.txt</code> index\n for machines, and sitemap/SEO data.\n </p>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n Automation keeps the outputs current: weekly syncs refresh stars,\n activity, and contributor data, and every change to a source file\n rebuilds everything derived from it. There is no database and no\n server — the output is static HTML, and the content stays portable\n in files you can fork.\n </p>\n </section>\n\n <section class=\"mt-10\">\n <h2 class=\"m-0 text-[1.25rem] sm:text-[1.375rem] font-semibold tracking-tight text-foreground\">\n How to contribute\n </h2>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n Because the content is files, contributing is a pull request: add a\n YAML record for a new {item}, fix a typo, or improve the metadata\n behind an existing listing. The <a href=\"/submit/\" class=\"font-medium underline decoration-border underline-offset-2 hover:decoration-ring\">submit page</a> drafts\n the YAML for you from a repository URL, and every submission is\n reviewed against the curation bar before it lands.\n </p>\n </section>\n\n <section class=\"mt-10 flex flex-wrap items-center gap-3\">\n <a href={`/${slug}/`} class={buttonClass(\"primary\", \"sm\")}>Browse the directory</a>\n {githubUrl && (\n <a\n href={githubUrl}\n target=\"_blank\"\n rel=\"noopener\"\n class={buttonClass(\"secondary\", \"sm\")}\n >\n View on GitHub\n </a>\n )}\n <a href=\"/submit/\" class={buttonClass(\"ghost\", \"sm\")}>Submit a {item} →</a>\n </section>\n </>\n )}\n {press.length > 0 && (\n <section class=\"mt-12 border-t border-border pt-8\" aria-labelledby=\"press-heading\">\n <h2 id=\"press-heading\" class=\"m-0 text-[1.25rem] font-semibold tracking-tight text-foreground\">Featured in</h2>\n <ul class=\"m-0 mt-4 flex list-none flex-col gap-2 p-0\">\n {press.map((item) => (\n <li class=\"m-0\">\n <a href={item.url} target=\"_blank\" rel=\"noopener\" class=\"flex items-center gap-3 rounded-[var(--radius-lg)] border border-border bg-card p-3 no-underline hover:border-ink-400 dark:hover:border-ink-600\">\n {item.logo && (\n <span class=\"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-white p-1.5\"><img src={item.logo} alt=\"\" width=\"20\" height=\"20\" class=\"h-5 w-5\" /></span>\n )}\n <span class=\"min-w-0\">\n <span class=\"block text-sm font-semibold text-foreground\">{item.title}</span>\n <span class=\"block text-2xs text-muted-foreground\">{item.outlet} · {new Date(`${item.date}-01T00:00:00Z`).toLocaleDateString('en-US', { month: 'long', year: 'numeric', timeZone: 'UTC' })}</span>\n </span>\n </a>\n </li>\n ))}\n </ul>\n </section>\n )}\n </article>\n </Container>\n</BaseLayout>\n",
478
478
  "type": "registry:page",
479
479
  "target": "~/src/pages/about.astro"
480
480
  },
@@ -486,7 +486,7 @@
486
486
  },
487
487
  {
488
488
  "path": "default/pages/404.astro",
489
- "content": "---\n/**\n * 404 — generic fallback page.\n *\n * Renders the normal shell (header / footer / theme toggle) with a\n * short message and a search form pointing at the list page. Stays\n * on-brand regardless of blueprint.\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport { indexSlug } from '@grove-dev/astro/server';\nimport SearchField from '../components/ui/search-field.astro';\nimport BaseLayout from '../layouts/base-layout.astro';\nimport { buttonClass } from '../lib/classnames.ts';\n\nconst slug = indexSlug();\nconst title = `Page not found | ${siteConfig.name}`;\nconst description = `That page doesn't exist on ${siteConfig.name}. Search the directory or browse from the home page.`;\n---\n\n<BaseLayout\n title={title}\n description={description}\n site={siteConfig}\n noindex\n>\n {/* One recovery hierarchy: search is the primary tool, Browse the\n single button action, home a quiet text link — no three\n competing primary CTAs. Centered so the wide viewport doesn't\n pin everything into the top-left corner. */}\n <section class=\"py-12 sm:py-16\">\n <div class=\"mx-auto w-full max-w-narrow px-5 py-16 text-center sm:px-7 sm:py-24\">\n <span class=\"text-2xs font-medium uppercase tracking-wider text-muted-foreground\">\n 404\n </span>\n <h1 class=\"m-0 mt-2 text-[2.25rem] font-semibold leading-[1.05] tracking-tight text-foreground sm:text-[3rem]\">\n Page not found\n </h1>\n <p class=\"mx-auto m-0 mt-4 max-w-xl text-lg leading-relaxed text-muted-foreground\">\n The page you're looking for doesn't exist on {siteConfig.name}.\n It may have been moved, renamed, or never existed.\n </p>\n\n <form\n class=\"mx-auto mt-8 flex max-w-xl flex-col gap-2 sm:flex-row sm:items-center\"\n role=\"search\"\n action={`/${slug}`}\n method=\"get\"\n >\n <SearchField class=\"flex-1\" label=\"Search\" placeholder={`Search ${slug}...`} id=\"not-found-search\" />\n <button type=\"submit\" class={buttonClass(\"primary\", \"bare\", \"h-10 px-4 text-sm max-sm:min-h-11\")}>\n Search\n </button>\n </form>\n\n <div class=\"mt-6 flex flex-wrap items-center justify-center gap-4\">\n <a href={`/${slug}/`} class={buttonClass(\"secondary\", \"sm\")}>Browse {slug}</a>\n <a href=\"/\" class=\"text-sm font-medium text-muted-foreground underline decoration-border underline-offset-2 hover:text-foreground\">\n Back to home\n </a>\n </div>\n </div>\n </section>\n</BaseLayout>\n",
489
+ "content": "---\n/**\n * 404 — generic fallback page.\n *\n * Renders the normal shell (header / footer / theme toggle) with a\n * short message and a search form pointing at the list page. Stays\n * on-brand regardless of blueprint.\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport { indexSlug } from '@grove-dev/astro/server';\nimport SearchField from '../components/ui/search-field.astro';\nimport BaseLayout from '../layouts/base-layout.astro';\nimport { buttonClass } from '../lib/classnames.ts';\n\nconst slug = indexSlug();\nconst title = `Page not found | ${siteConfig.name}`;\nconst description = `That page doesn't exist on ${siteConfig.name}. Search the directory or browse from the home page.`;\n---\n\n<BaseLayout\n title={title}\n description={description}\n site={siteConfig}\n noindex\n>\n {/* One recovery hierarchy: search is the primary tool, Browse the\n single button action, home a quiet text link — no three\n competing primary CTAs. Centered so the wide viewport doesn't\n pin everything into the top-left corner. */}\n <section class=\"py-12 sm:py-16\">\n <div class=\"mx-auto w-full max-w-narrow px-5 py-16 text-center sm:px-7 sm:py-24\">\n <span class=\"text-2xs font-medium uppercase tracking-wider text-muted-foreground\">\n 404\n </span>\n <h1 class=\"m-0 mt-2 text-[2.25rem] font-semibold leading-[1.05] tracking-tight text-foreground sm:text-[3rem]\">\n Page not found\n </h1>\n <p class=\"mx-auto m-0 mt-4 max-w-xl text-lg leading-relaxed text-muted-foreground\">\n The page you're looking for doesn't exist on {siteConfig.name}.\n It may have been moved, renamed, or never existed.\n </p>\n\n <form\n class=\"mx-auto mt-8 flex max-w-xl flex-col gap-2 sm:flex-row sm:items-center\"\n role=\"search\"\n action={`/${slug}/`}\n method=\"get\"\n >\n <SearchField class=\"flex-1\" label=\"Search\" placeholder={`Search ${slug}...`} id=\"not-found-search\" />\n <button type=\"submit\" class={buttonClass(\"primary\", \"bare\", \"h-10 px-4 text-sm max-sm:min-h-11\")}>\n Search\n </button>\n </form>\n\n <div class=\"mt-6 flex flex-wrap items-center justify-center gap-4\">\n <a href={`/${slug}/`} class={buttonClass(\"secondary\", \"sm\")}>Browse {slug}</a>\n <a href=\"/\" class=\"text-sm font-medium text-muted-foreground underline decoration-border underline-offset-2 hover:text-foreground\">\n Back to home\n </a>\n </div>\n </div>\n </section>\n</BaseLayout>\n",
490
490
  "type": "registry:page",
491
491
  "target": "~/src/pages/404.astro"
492
492
  },
@@ -499,7 +499,7 @@
499
499
  ],
500
500
  "meta": {
501
501
  "version": "1.6.0",
502
- "requiresGrove": "1.3.1"
502
+ "requiresGrove": "1.4.0"
503
503
  },
504
504
  "type": "registry:block"
505
505
  }