@happyvertical/smrt-template-site-static-json 0.30.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.
@@ -0,0 +1,95 @@
1
+ <script lang="ts">
2
+ import type { PageData } from './$types';
3
+
4
+ let { data }: { data: PageData } = $props();
5
+ const { siteConfig } = data;
6
+ </script>
7
+
8
+ <svelte:head>
9
+ <title>Contact - {siteConfig.name}</title>
10
+ <meta name="description" content="Contact {siteConfig.name}" />
11
+ </svelte:head>
12
+
13
+ <div class="contact">
14
+ <h1>Contact {siteConfig.name}</h1>
15
+
16
+ <section>
17
+ <h2>Get in Touch</h2>
18
+ <p>
19
+ Have a question, feedback, or news tip? We'd love to hear from you.
20
+ </p>
21
+ <p>
22
+ <strong>Email:</strong> <a href="mailto:contact@{{PACKAGE_NAME}}.com">contact@{{PACKAGE_NAME}}.com</a>
23
+ </p>
24
+ </section>
25
+
26
+ <section>
27
+ <h2>Submit a Tip</h2>
28
+ <p>
29
+ Know about an upcoming event, a community story, or something happening in {siteConfig.location.name}?
30
+ Send us a message and we'll look into it.
31
+ </p>
32
+ </section>
33
+
34
+ <section>
35
+ <h2>Official Resources</h2>
36
+ <p>
37
+ For official government business, please contact your local government directly.
38
+ </p>
39
+ </section>
40
+
41
+ <section class="disclaimer">
42
+ <h2>Disclaimer</h2>
43
+ <p>
44
+ {siteConfig.name} is an independent community news service. We are not affiliated with
45
+ any government entity. Our coverage is based on publicly available documents and official sources.
46
+ </p>
47
+ </section>
48
+ </div>
49
+
50
+ <style>
51
+ .contact {
52
+ max-width: 700px;
53
+ }
54
+
55
+ h1 {
56
+ font-size: var(--font-size-2xl);
57
+ margin-bottom: var(--spacing-xl);
58
+ color: var(--color-neutral-gray900);
59
+ }
60
+
61
+ section {
62
+ margin-bottom: var(--spacing-xl);
63
+ }
64
+
65
+ h2 {
66
+ font-size: var(--font-size-lg);
67
+ margin-bottom: var(--spacing-md);
68
+ color: var(--color-neutral-gray800);
69
+ }
70
+
71
+ p {
72
+ line-height: 1.7;
73
+ color: var(--color-neutral-gray700);
74
+ margin-bottom: var(--spacing-md);
75
+ }
76
+
77
+ a {
78
+ color: var(--color-primary);
79
+ }
80
+
81
+ .disclaimer {
82
+ padding: var(--spacing-lg);
83
+ background: var(--color-neutral-gray100);
84
+ border-radius: var(--radius-md);
85
+ }
86
+
87
+ .disclaimer h2 {
88
+ font-size: var(--font-size-md);
89
+ }
90
+
91
+ .disclaimer p {
92
+ font-size: var(--font-size-sm);
93
+ margin-bottom: 0;
94
+ }
95
+ </style>
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Site Configuration Helper
3
+ *
4
+ * Provides typed access to site configuration from smrt.config.js
5
+ */
6
+
7
+ import { loadConfig, getSiteConfig, type SiteConfig } from '@happyvertical/smrt-config';
8
+
9
+ let _siteConfig: SiteConfig | null = null;
10
+
11
+ /**
12
+ * Initialize and load site configuration
13
+ * Call this in +layout.server.ts before accessing config
14
+ */
15
+ export async function initSiteConfig(): Promise<SiteConfig> {
16
+ if (!_siteConfig) {
17
+ await loadConfig();
18
+ _siteConfig = getSiteConfig();
19
+ }
20
+ if (!_siteConfig) {
21
+ throw new Error('Site configuration not found in smrt.config.js. Ensure site: {} section exists.');
22
+ }
23
+ return _siteConfig;
24
+ }
25
+
26
+ /**
27
+ * Get site configuration synchronously
28
+ * Only call after initSiteConfig() has been called
29
+ */
30
+ export function getSite(): SiteConfig {
31
+ if (!_siteConfig) {
32
+ throw new Error('Site config not initialized. Call initSiteConfig() in +layout.server.ts first.');
33
+ }
34
+ return _siteConfig;
35
+ }
@@ -0,0 +1,19 @@
1
+ import adapter from '@sveltejs/adapter-static';
2
+ import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
3
+
4
+ /** @type {import('@sveltejs/kit').Config} */
5
+ const config = {
6
+ preprocess: vitePreprocess(),
7
+
8
+ kit: {
9
+ adapter: adapter({
10
+ pages: 'build',
11
+ assets: 'build',
12
+ fallback: undefined,
13
+ precompress: false,
14
+ strict: true,
15
+ }),
16
+ },
17
+ };
18
+
19
+ export default config;
@@ -0,0 +1,14 @@
1
+ {
2
+ "extends": "./.svelte-kit/tsconfig.json",
3
+ "compilerOptions": {
4
+ "allowJs": true,
5
+ "checkJs": true,
6
+ "esModuleInterop": true,
7
+ "forceConsistentCasingInFileNames": true,
8
+ "resolveJsonModule": true,
9
+ "skipLibCheck": true,
10
+ "sourceMap": true,
11
+ "strict": true,
12
+ "moduleResolution": "bundler"
13
+ }
14
+ }
@@ -0,0 +1,6 @@
1
+ import { sveltekit } from '@sveltejs/kit/vite';
2
+ import { defineConfig } from 'vite';
3
+
4
+ export default defineConfig({
5
+ plugins: [sveltekit()],
6
+ });
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Static Site Template Configuration
3
+ *
4
+ * Template for community news sites with:
5
+ * - JSON-based data storage
6
+ * - Static site generation (SvelteKit)
7
+ * - Weather integration (Caelus)
8
+ * - Meeting scraping (Praeco)
9
+ * - Config-driven site identity
10
+ */
11
+
12
+ export default {
13
+ name: 'site-static-json',
14
+ description: 'Static community site with JSON data storage',
15
+ framework: 'sveltekit',
16
+ version: '1.0.0',
17
+
18
+ // Template directory location
19
+ templateDir: './template',
20
+
21
+ // Dependencies for generated project
22
+ // Note: template/package.json intentionally has empty dependencies/devDependencies;
23
+ // the scaffolder injects the entries below at generation time, so this file is
24
+ // the single source of truth for dependency versions.
25
+ dependencies: {
26
+ '@happyvertical/smrt-core': '^0.24.8',
27
+ '@happyvertical/smrt-config': '^0.24.8',
28
+ '@happyvertical/smrt-ui': '^0.24.8',
29
+ '@happyvertical/smrt-content': '^0.24.8',
30
+ '@happyvertical/smrt-events': '^0.24.8',
31
+ '@happyvertical/smrt-places': '^0.24.8',
32
+ '@happyvertical/smrt-profiles': '^0.24.8',
33
+ '@happyvertical/caelus': '^0.1.385',
34
+ },
35
+
36
+ devDependencies: {
37
+ '@happyvertical/praeco': '^0.2.398',
38
+ '@sveltejs/adapter-static': '^3.0.10',
39
+ '@sveltejs/kit': '^2.55.0',
40
+ '@sveltejs/vite-plugin-svelte': '^6.2.4',
41
+ svelte: '^5.18.0',
42
+ 'svelte-check': '^4.3.5',
43
+ typescript: '^5.9.3',
44
+ vite: '^7.3.1',
45
+ tsx: '^4.0.0',
46
+ },
47
+
48
+ // Placeholder substitutions for template files
49
+ placeholders: {
50
+ '{{SITE_NAME}}': (ctx) => ctx.siteName,
51
+ '{{SITE_SHORT_NAME}}': (ctx) => {
52
+ // Extract first part of location or use site name
53
+ const loc = ctx.location || ctx.siteName;
54
+ return loc.split(',')[0].trim();
55
+ },
56
+ '{{PACKAGE_NAME}}': (ctx) => ctx.name.toLowerCase().replace(/[^a-z0-9-]/g, '-'),
57
+ '{{LOCATION_NAME}}': (ctx) => ctx.location || ctx.siteName,
58
+ '{{LATITUDE}}': (ctx) => String(ctx.latitude || 0),
59
+ '{{LONGITUDE}}': (ctx) => String(ctx.longitude || 0),
60
+ '{{TIMEZONE}}': (ctx) => ctx.timezone || 'America/Edmonton',
61
+ },
62
+
63
+ // Files configuration
64
+ files: {
65
+ skip: ['.gitkeep'],
66
+ },
67
+
68
+ // Post-generation hooks
69
+ hooks: {
70
+ afterGenerate: async (ctx) => {
71
+ console.log(`\n Site "${ctx.siteName}" created successfully!`);
72
+ console.log('\nNext steps:');
73
+ console.log(` cd ${ctx.name}`);
74
+ console.log(' pnpm install');
75
+ console.log(' cp .env.example .env');
76
+ console.log(' pnpm run init-data');
77
+ console.log(' pnpm dev');
78
+ console.log();
79
+ console.log('To configure your site:');
80
+ console.log(' 1. Edit smrt.config.js to add Praeco sources (councils)');
81
+ console.log(' 2. Customize about/contact page content');
82
+ console.log(' 3. Update theme colors in smrt.config.js');
83
+ console.log();
84
+ },
85
+ },
86
+ };