@happyvertical/template-site-static-json
Scaffold template for static community news sites with JSON data storage. Includes a local WeatherHeader shim and stubbed Caelus/Praeco workflow scripts on the v0.29.32 baseline.
Overview
@happyvertical/smrt-template-site-static-json generates a SvelteKit static
community-news site with JSON file-based data storage. It is the template smrt gnode create expands when you pass --template site-static-json: pre-built routes (home, about,
contact), Markdown rendering, config-driven site identity, and integration hooks for weather
forecasts (Caelus) and council-meeting article generation (Praeco). The build emits static
HTML for any CDN.
Usage
smrt gnode create my-town-site --template site-static-json \
--location "My Town, AB" \
--lat 53.5 --lon -113.5
cd my-town-site
pnpm install
cp .env.example .env # Add your GEMINI_API_KEY
pnpm run init-data # Initialize data directory
pnpm dev # Start dev serverWhat the Template Provides
- SvelteKit with
adapter-staticfor static-site generation - JSON file-based data storage in
data/ - Config-driven site identity, navigation, categories, and theming via
smrt.config.js - Caelus-shaped weather payload rendering (via the local
WeatherHeader.svelteshim — see below) - Praeco integration scaffolding for council-meeting scraping and article generation (workflow scripts stubbed — see below)
- Typed site config helper (
initSiteConfig()/getSite()) - Pre-built routes: home, about, contact
- Markdown utility for content rendering
WeatherHeader Shim
The template ships template/src/lib/components/WeatherHeader.svelte as a local
shim. It used to be imported from @happyvertical/smrt-svelte, but that package no
longer ships the component, so the template inlines an equivalent.
The shim renders the Caelus-shaped forecast payload (current conditions plus a
short outlook). If you wire a different weather provider — or restructure the forecast object
— edit this file in your generated project to suit your data layer. The shim has no upstream
dependency, so customising it does not break pnpm update.
Workflow Scripts (Stubs on v0.29.32)
pnpm run workflow:caelus and pnpm run workflow:praeco are documented contracts
but currently ship as stub scripts. They print an "upstream package needs a CLI bin" message
and exit with status 1.
Two independent reasons today's scaffold cannot run them:
- Upstream packages are library-only.
@happyvertical/caelusand@happyvertical/praecodo not declare abinfield, sonpx @happyvertical/caelus/npx @happyvertical/praecoexits with "could not determine executable to run." - No local workflow shim. The template does not ship
template/src/workflows/caelus.tsortemplate/src/workflows/praeco.tsfiles that would import the upstream package and invoke the workflow programmatically. Atsx-based script would work fine once such a shim exists.
Once upstream ships CLI bins, the stubs can be replaced with npx @happyvertical/caelus --config smrt.config.js and npx @happyvertical/praeco --config smrt.config.js (note the scoped names — the
unscoped caelus package is a 404 on the public registry). Alternatively, add a template/src/workflows/<name>.ts shim that imports the upstream main export
and invokes the workflow, then point the script at tsx src/workflows/<name>.ts. Until either lands, callers who need these
workflows should write the shim themselves in their generated project.
Configuration
Edit smrt.config.js to customize. Key sections:
site-- name, description, location, navigation links, theme colorscategories-- content categories for routing (e.g.,politics/local)modules.praeco-- council meeting sources and report configurationsmodules.caelus-- weather location (set automatically from--lat/--lonflags)
Environment Variables
| Variable | Required | Description |
|---|---|---|
GEMINI_API_KEY | Yes | Google Gemini API key for Praeco article generation |
PUBLIC_GTM_ID | No | Google Tag Manager container ID |
CUSTOM_DOMAIN | No | Custom domain for deployment |
Available Scripts
| Script | Description |
|---|---|
pnpm dev | Start development server |
pnpm build | Build static site to ./build |
pnpm preview | Preview the built site |
pnpm run init-data | Initialize JSON data files |
pnpm run workflow:caelus | Stub. Prints "upstream package needs a CLI bin" and exits 1 (see Workflow Scripts). |
pnpm run workflow:praeco | Stub. Prints "upstream package needs a CLI bin" and exits 1 (see Workflow Scripts). |
pnpm run validate:json | Validate JSON data files |
pnpm run validate:slugs | Validate content slugs |
Placeholder Substitution
During smrt gnode create, placeholders are replaced from CLI flags:
{{SITE_NAME}}, {{LOCATION_NAME}}, {{LATITUDE}}, {{LONGITUDE}}, {{TIMEZONE}}. See template.config.js for the full mapping.
Deployment
Build and deploy to any static host:
pnpm build
# Deploy ./build to S3, Netlify, Vercel, Cloudflare Pages, etc.