@happyvertical/template-site-static-json

Template for static community news sites with JSON-based data storage, weather integration (Caelus), and council meeting scraping (Praeco).

v0.20.44TemplateStatic SiteJSON

Overview

@happyvertical/smrt-template-site-static-json generates a SvelteKit static site with JSON file-based data storage. It includes weather forecasts via Caelus (Environment Canada), council meeting scraping and article generation via Praeco, config-driven site identity, and pre-built routes (home, about, contact). Sites build to static HTML for deployment to any CDN.

Usage

bash
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 server

What the Template Provides

  • SvelteKit with adapter-static for static site generation
  • JSON file-based data storage in data/
  • Config-driven site identity, navigation, categories, and theming via smrt.config.js
  • Weather forecasts via Caelus (Environment Canada)
  • Council meeting scraping and article generation via Praeco
  • Typed site config helper (initSiteConfig() / getSite())
  • Pre-built routes: home, about, contact
  • Markdown utility for content rendering

Configuration

Edit smrt.config.js to customize. Key sections:

  • site -- name, description, location, navigation links, theme colors
  • categories -- content categories for routing (e.g., politics/local)
  • modules.praeco -- council meeting sources and report configurations
  • modules.caelus -- weather location (set automatically from --lat/--lon flags)

Environment Variables

VariableRequiredDescription
GEMINI_API_KEYYesGoogle Gemini API key for Praeco article generation
PUBLIC_GTM_IDNoGoogle Tag Manager container ID
CUSTOM_DOMAINNoCustom domain for deployment

Available Scripts

ScriptDescription
pnpm devStart development server
pnpm buildBuild static site to ./build
pnpm previewPreview the built site
pnpm run init-dataInitialize JSON data files
pnpm run workflow:caelusFetch weather data
pnpm run workflow:praecoScrape council meetings
pnpm run validate:jsonValidate JSON data files
pnpm run validate:slugsValidate 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:

bash
pnpm build
# Deploy ./build to S3, Netlify, Vercel, Cloudflare Pages, etc.