| {t.name} | +{t.level} | +{t.features} | +{t.requires} | +{t.command} | +
|---|---|---|---|---|
| + + {m.meta.title} + + | ++ {t.levels[m.meta.level]} + | +
+ {m.meta.features.slice(0, 4).map((f) => (
+ {f}
+ ))}
+ {m.meta.features.length > 4 && +{m.meta.features.length - 4}}
+ |
+ + {m.meta.dependencies.length === 0 ? ( + - + ) : ( + m.meta.dependencies.map((d) => {d}) + )} + | +
+ {isCommand(m.meta.command) ? (
+ /{m.meta.command}
+ ) : (
+ {m.meta.command}
+ )}
+ |
+
{t.empty}
} diff --git a/src/components/DownloadCard.astro b/src/components/DownloadCard.astro new file mode 100644 index 0000000..3921f8b --- /dev/null +++ b/src/components/DownloadCard.astro @@ -0,0 +1,173 @@ +--- +// DownloadCard.astro +// Two download buttons: single menu.conf and full bundle (.zip via JSZip). +// Bundle includes: menu.conf, local templates.conf (if exists), _shared/templates.conf (if uses_shared_templates), INSTALL.txt. + +interface Meta { + uses_shared_templates: boolean; + command: string; + title: string; +} + +interface Props { + path: string; // e.g. "shops/01-cake-shop" + lang: 'en' | 'ru'; + meta: Meta; + hasLocalTemplates: boolean; +} + +const { path, lang, meta, hasLocalTemplates } = Astro.props; + +// Use ?url import so Vite bundles the file into dist/_astro/ with a hashed name. +// Without this, the literal `/examples/...` URL would 404 in production +// because examples/ isn't under public/. +const menuFileUrls = import.meta.glob('/examples/**/menu.conf', { + query: '?url', + import: 'default', + eager: true, +}) as Record+ {meta.uses_shared_templates ? t.bundleIncludesShared : t.bundleIncludesPlain} +
+