From 1629af1f7290cbc22384e024c9d8d82fa1f6a2a4 Mon Sep 17 00:00:00 2001
From: Karim <98668332+khadni@users.noreply.github.com>
Date: Mon, 16 Mar 2026 16:30:12 -0500
Subject: [PATCH 1/2] enable cre cli template cmd
---
.../CRETemplate/CRETemplateOverview.astro | 76 +++++++++++--------
src/content.config.ts | 1 +
.../cre-templates/bring-your-own-data.mdx | 1 +
src/layouts/CRETemplateLayout.astro | 5 +-
src/pages/cre-templates/[...id].astro | 7 +-
5 files changed, 51 insertions(+), 39 deletions(-)
diff --git a/src/components/CRETemplate/CRETemplateOverview.astro b/src/components/CRETemplate/CRETemplateOverview.astro
index e8c509ba151..3de57674b57 100644
--- a/src/components/CRETemplate/CRETemplateOverview.astro
+++ b/src/components/CRETemplate/CRETemplateOverview.astro
@@ -3,9 +3,8 @@ import { CRETemplatesFrontmatter } from "~/content.config.ts"
interface Props {
frontmatter: CRETemplatesFrontmatter
- templateSlug: string
}
-const { frontmatter, templateSlug } = Astro.props
+const { frontmatter } = Astro.props
---
@@ -28,33 +27,43 @@ const { frontmatter, templateSlug } = Astro.props
{frontmatter.description}
-
-
-
Get the template
-
-
-
cre init --template={templateSlug}
-
-
-
-
-
+ )
+ }
@@ -121,7 +130,6 @@ const { frontmatter, templateSlug } = Astro.props
max-width: 500px;
}
- /* Hidden until CLI is available — remove style="display: none;" from .get-template to re-enable */
.get-template {
display: flex;
flex-direction: column;
@@ -137,7 +145,7 @@ const { frontmatter, templateSlug } = Astro.props
.template-actions {
display: flex;
flex-wrap: wrap;
- align-items: center;
+ align-items: stretch;
gap: var(--space-3x);
}
@@ -145,7 +153,7 @@ const { frontmatter, templateSlug } = Astro.props
display: inline-flex;
align-items: center;
gap: var(--space-3x);
- padding: 12px 18px;
+ padding: 0 18px;
background: #1e293b;
border-radius: 6px;
font-family: var(--font-mono, monospace);
@@ -201,10 +209,14 @@ const { frontmatter, templateSlug } = Astro.props
font-size: 14px;
font-weight: 600;
border: 1px solid #0847f7;
- border-radius: 4px;
+ border-radius: 6px;
text-decoration: none;
transition: all 0.2s ease;
- min-width: 120px;
+ white-space: nowrap;
+ }
+
+ .github-buttons .github-btn {
+ padding: 12px 28px;
}
.github-btn:hover {
diff --git a/src/content.config.ts b/src/content.config.ts
index 3120ab1d897..df405f0aa0c 100644
--- a/src/content.config.ts
+++ b/src/content.config.ts
@@ -102,6 +102,7 @@ const creTemplatesFrontmatter = z
), // Links to GitHub folders for each language variant
image: z.string(),
featured: z.boolean().optional(), // Whether this template is featured on the hub page
+ cliTemplateId: z.string().optional(), // CLI ID for `cre init --template=