campsitejs 0.0.4 → 0.0.6

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.
package/index.js CHANGED
@@ -23,6 +23,35 @@ async function getCliVersion() {
23
23
  }
24
24
  }
25
25
 
26
+ function showHelp(version) {
27
+ console.log(kleur.bold().cyan(`\nšŸ•ļø CampsiteJS v${version}`));
28
+ console.log(kleur.dim("Create a new static site with CampsiteJS.\n"));
29
+
30
+ console.log(kleur.bold("Usage:"));
31
+ console.log(" npm create campsitejs@latest [project-name]");
32
+ console.log(" npx campsitejs [project-name]\n");
33
+
34
+ console.log(kleur.bold("Options:"));
35
+ console.log(" -h, --help Show this help message");
36
+ console.log(" -v, --version Show version number\n");
37
+
38
+ console.log(kleur.bold("Examples:"));
39
+ console.log(" " + kleur.dim("# Create a new project interactively"));
40
+ console.log(" npm create campsitejs@latest");
41
+ console.log(" " + kleur.dim("# Create with a specific name"));
42
+ console.log(" npm create campsitejs@latest my-site\n");
43
+
44
+ console.log(kleur.bold("After Setup:"));
45
+ console.log(" cd your-project-name");
46
+ console.log(" campsite dev " + kleur.dim("# Start development server"));
47
+ console.log(" campsite build " + kleur.dim("# Build for production"));
48
+ console.log(" campsite make:page " + kleur.dim("# Create new content"));
49
+ console.log(" campsite --help " + kleur.dim("# See all available commands\n"));
50
+
51
+ console.log(kleur.dim("For more information, visit: https://campsitejs.dev"));
52
+ console.log();
53
+ }
54
+
26
55
  async function ensureDir(dir) {
27
56
  await mkdir(dir, { recursive: true });
28
57
  }
@@ -86,11 +115,13 @@ async function writeConfig(targetDir, answers) {
86
115
  outDir: "dist",
87
116
  templateEngine: "${primaryEngine}",
88
117
  markdown: ${answers.markdown},
89
- minifyCSS: false,
90
- minifyHTML: false,
118
+ minifyCSS: ${answers.minifyAssets},
119
+ minifyHTML: ${answers.minifyAssets},
120
+ cacheBustAssets: ${answers.cacheBustAssets}, // Add content hashes to JS/CSS filenames
91
121
  integrations: {
92
122
  nunjucks: ${answers.templateEngines.includes("nunjucks")},
93
123
  liquid: ${answers.templateEngines.includes("liquid")},
124
+ mustache: ${answers.templateEngines.includes("mustache")},
94
125
  vue: ${answers.jsFrameworks.includes("vue")},
95
126
  alpine: ${answers.jsFrameworks.includes("alpine")}
96
127
  }
@@ -118,6 +149,7 @@ async function updatePackageJson(targetDir, answers) {
118
149
  if (answers.markdown) devDeps["markdown-it"] = "^14.1.0";
119
150
  if (answers.templateEngines.includes("nunjucks")) devDeps["nunjucks"] = "^3.2.4";
120
151
  if (answers.templateEngines.includes("liquid")) devDeps["liquidjs"] = "^10.12.0";
152
+ if (answers.templateEngines.includes("mustache")) devDeps["mustache"] = "^4.2.0";
121
153
  if (answers.jsFrameworks.includes("vue")) deps["vue"] = "^3.4.0";
122
154
  if (answers.jsFrameworks.includes("alpine")) deps["alpinejs"] = "^3.13.0";
123
155
 
@@ -178,6 +210,7 @@ async function copyVariantFiles(srcDir, destDir, ext) {
178
210
  async function applyTemplateVariants(targetDir, answers) {
179
211
  const wantsNunjucks = answers.templateEngines.includes("nunjucks");
180
212
  const wantsLiquid = answers.templateEngines.includes("liquid");
213
+ const wantsMustache = answers.templateEngines.includes("mustache");
181
214
  const srcRoot = join(targetDir, "src");
182
215
  const layoutsDir = join(srcRoot, "layouts");
183
216
  const pagesDir = join(srcRoot, "pages");
@@ -193,10 +226,13 @@ async function applyTemplateVariants(targetDir, answers) {
193
226
 
194
227
  const njkLayouts = join(variantDir, "layouts");
195
228
  const liquidLayouts = join(variantDir, "layouts");
229
+ const mustacheLayouts = join(variantDir, "layouts");
196
230
  const njkPages = join(variantDir, "pages");
197
231
  const liquidPages = join(variantDir, "pages");
232
+ const mustachePages = join(variantDir, "pages");
198
233
  const njkPartials = join(variantDir, "partials");
199
234
  const liquidPartials = join(variantDir, "partials");
235
+ const mustachePartials = join(variantDir, "partials");
200
236
 
201
237
  if (wantsNunjucks) {
202
238
  await copyVariantFiles(njkLayouts, layoutsDir, ".njk");
@@ -210,9 +246,16 @@ async function applyTemplateVariants(targetDir, answers) {
210
246
  await copyVariantFiles(liquidPartials, partialsDir, ".liquid");
211
247
  }
212
248
 
249
+ if (wantsMustache) {
250
+ await copyVariantFiles(mustacheLayouts, layoutsDir, ".mustache");
251
+ await copyVariantFiles(mustachePages, pagesDir, ".mustache");
252
+ await copyVariantFiles(mustachePartials, partialsDir, ".mustache");
253
+ }
254
+
213
255
  // Provide a Markdown starter when requested, pointing at the primary engine layout
214
256
  const primaryEngine = answers.templateEngines[0] || "nunjucks";
215
- const mdLayout = primaryEngine === "liquid" ? "base.liquid" : "base.njk";
257
+ const layoutExtMap = { liquid: "base.liquid", mustache: "base.mustache", nunjucks: "base.njk" };
258
+ const mdLayout = layoutExtMap[primaryEngine] || "base.njk";
216
259
 
217
260
  if (answers.markdown) {
218
261
  const mdContent = `---
@@ -227,7 +270,7 @@ CampsiteJS sets up a warm starter for Markdown, Nunjucks, Liquid, Vue, and Alpin
227
270
 
228
271
  - Edit src/pages/index.md to make it yours.
229
272
  - Tweak the layout in src/layouts/${mdLayout}.
230
- - Add data under src/data/, components in src/components/, and partials in src/partials/.
273
+ - Add data under src/collections/, components in src/components/, and partials in src/partials/.
231
274
 
232
275
  Happy camping! šŸŒ²šŸ•ļøšŸ”„
233
276
  `;
@@ -275,10 +318,23 @@ async function installDependencies(targetDir, packageManager) {
275
318
 
276
319
  async function main() {
277
320
  const version = await getCliVersion();
278
- console.log(kleur.bold().cyan(`\nšŸ•ļø Welcome to CampSiteJS v${version}`));
321
+ const firstArg = process.argv[2];
322
+
323
+ // Handle flags
324
+ if (firstArg === "-h" || firstArg === "--help") {
325
+ showHelp(version);
326
+ process.exit(0);
327
+ }
328
+
329
+ if (firstArg === "-v" || firstArg === "--version") {
330
+ console.log(`v${version}`);
331
+ process.exit(0);
332
+ }
333
+
334
+ console.log(kleur.bold().cyan(`\nšŸ•ļø Welcome to CampsiteJS v${version}`));
279
335
  console.log(kleur.dim("Build a cozy static campsite in seconds.\n"));
280
336
 
281
- const argProjectName = process.argv[2];
337
+ const argProjectName = firstArg;
282
338
  const defaultProjectName = argProjectName || nextCampsiteName(process.cwd());
283
339
  const answers = await prompts([
284
340
  {
@@ -298,13 +354,14 @@ async function main() {
298
354
  {
299
355
  type: "multiselect",
300
356
  name: "templateEngines",
301
- message: "Choose templating engines",
357
+ message: "Choose templating languages",
302
358
  hint: "Use space to toggle, enter to confirm",
303
359
  instructions: false,
304
360
  min: 1,
305
361
  choices: [
306
362
  { title: "Nunjucks", value: "nunjucks", selected: true },
307
- { title: "Liquid", value: "liquid" }
363
+ { title: "Liquid", value: "liquid" },
364
+ { title: "Mustache", value: "mustache" }
308
365
  ]
309
366
  },
310
367
  {
@@ -331,6 +388,22 @@ async function main() {
331
388
  { title: "Bulma", value: "bulma" }
332
389
  ]
333
390
  },
391
+ {
392
+ type: "toggle",
393
+ name: "cacheBustAssets",
394
+ message: "Enable cache busting for CSS/JS assets?",
395
+ initial: true,
396
+ active: "yes",
397
+ inactive: "no"
398
+ },
399
+ {
400
+ type: "toggle",
401
+ name: "minifyAssets",
402
+ message: "Minify CSS and HTML assets?",
403
+ initial: true,
404
+ active: "yes",
405
+ inactive: "no"
406
+ },
334
407
  {
335
408
  type: "select",
336
409
  name: "packageManager",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "campsitejs",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "type": "module",
5
5
  "description": "Create a new Campsite static site (campsitejs).",
6
6
  "bin": {
@@ -6,6 +6,7 @@ export default {
6
6
  markdown: true,
7
7
  minifyCSS: false,
8
8
  minifyHTML: false,
9
+ cacheBustAssets: false, // Set to true to add content hashes to JS/CSS filenames
9
10
  integrations: {
10
11
  nunjucks: true,
11
12
  liquid: false,
@@ -14,7 +14,7 @@
14
14
  "postinstall": "npm run build:css"
15
15
  },
16
16
  "dependencies": {
17
- "basecampjs": "^0.0.6"
17
+ "basecampjs": "^0.0.9"
18
18
  },
19
19
  "devDependencies": {
20
20
  "npm-run-all": "^4.1.5",
@@ -8,7 +8,7 @@
8
8
  },
9
9
  {
10
10
  "label": "Docs",
11
- "url": "https://campsitejs.foxgrovemedia.com/docs/overview",
11
+ "url": "https://campsitejs.dev/docs/overview",
12
12
  "target": "_blank"
13
13
  },
14
14
  {
@@ -0,0 +1,60 @@
1
+ <!doctype html>
2
+ <html lang="en" class="min-h-screen bg-radial bg-gradient-to-br from-campfire-900 from-10% to-black to-90%">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>{{#page.title}}{{page.title}}{{/page.title}}{{^page.title}}{{#site.name}}{{site.name}}{{/site.name}}{{/page.title}}</title>
7
+ <meta name="description" content="{{#page.description}}{{page.description}}{{/page.description}}{{^page.description}}A cozy CampsiteJS starter.{{/page.description}}">
8
+ {{#frontmatter.robots}}
9
+ <meta name="robots" content="{{frontmatter.robots}}">
10
+ {{/frontmatter.robots}}
11
+ {{#frontmatter.canonical}}
12
+ <link rel="canonical" href="{{frontmatter.canonical}}">
13
+ {{/frontmatter.canonical}}
14
+ <meta property="og:title" content="{{#page.title}}{{page.title}}{{/page.title}}{{^page.title}}{{#site.name}}{{site.name}}{{/site.name}}{{/page.title}}">
15
+ <meta property="og:description" content="{{#page.description}}{{page.description}}{{/page.description}}{{^page.description}}A cozy CampsiteJS starter.{{/page.description}}">
16
+ {{#frontmatter.canonical}}
17
+ <meta property="og:url" content="{{frontmatter.canonical}}">
18
+ {{/frontmatter.canonical}}
19
+ <meta property="og:type" content="{{#frontmatter.og_type}}{{frontmatter.og_type}}{{/frontmatter.og_type}}{{^frontmatter.og_type}}website{{/frontmatter.og_type}}">
20
+ <meta property="og:site_name" content="{{site.name}}">
21
+ <meta name="twitter:card" content="{{#frontmatter.twitter_card}}{{frontmatter.twitter_card}}{{/frontmatter.twitter_card}}{{^frontmatter.twitter_card}}summary_large_image{{/frontmatter.twitter_card}}">
22
+ <meta name="twitter:title" content="{{#page.title}}{{page.title}}{{/page.title}}{{^page.title}}{{#site.name}}{{site.name}}{{/site.name}}{{/page.title}}">
23
+ <meta name="twitter:description" content="{{#page.description}}{{page.description}}{{/page.description}}{{^page.description}}A cozy CampsiteJS starter.{{/page.description}}">
24
+ {{#frontmatter.canonical}}
25
+ <meta name="twitter:url" content="{{frontmatter.canonical}}">
26
+ {{/frontmatter.canonical}}
27
+ <link rel="stylesheet" href="/style.css">
28
+ <link rel="preconnect" href="https://fonts.googleapis.com">
29
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
30
+ <link href="https://fonts.googleapis.com/css2?family=Caprasimo&display=swap" rel="stylesheet">
31
+ </head>
32
+ <body class="space-y-12 font-serif">
33
+ <header class="bg-stone-950 flex items-stretch justify-between py-2 px-6">
34
+ <a href="/" class="inline-flex items-center text-amber-50 font-bold text-lg tracking-wide py-3">
35
+ <svg class="h-6" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 550 139"><path d="M546.049 88.96q1.664 0 2.56 1.024 1.024 1.024 1.024 2.56 0 1.408-1.024 2.816-3.712 4.48-11.136 7.168-7.296 2.56-15.872 2.56-9.216 0-16.64-4.096-7.424-4.224-11.648-11.648-4.224-7.425-4.224-16.768 0-9.855 4.352-17.792 4.48-8.064 12.032-12.672 7.68-4.608 17.024-4.608 7.296 0 12.928 2.56 5.76 2.432 8.96 6.912 3.2 4.352 3.2 9.728 0 7.552-6.912 12.288-6.784 4.608-18.048 4.608-7.424 0-14.336-1.92-6.784-2.048-10.88-5.248-.64 3.584-.64 6.656 0 7.04 3.2 12.672 3.2 5.505 8.832 8.576t12.8 3.072q7.553 0 13.056-1.792 5.504-1.92 8.32-5.504 1.152-1.152 3.072-1.152m-23.552-43.776q-7.552 0-13.568 3.712-6.017 3.712-9.216 10.368 3.583 2.944 9.6 4.992 6.144 2.048 13.312 2.048 7.936 0 12.544-2.56 4.736-2.56 4.736-6.784 0-4.992-4.864-8.32-4.864-3.456-12.544-3.456M483.336 39.04q1.663 0 2.688 1.152 1.152 1.024 1.152 2.688 0 1.536-1.152 2.688-1.024 1.152-2.688 1.152h-13.824q0 34.688.128 39.168.128 4.864 2.304 6.912 2.304 2.048 5.888 2.944 1.663.383 2.688 1.664 1.024 1.152 1.024 2.816t-1.28 2.688q-1.152 1.024-2.816 1.024-3.968 0-7.552-1.92-3.584-2.047-5.76-5.76t-2.176-8.576q0-23.935-.128-40.96h-7.04q-1.536 0-2.688-1.152t-1.152-2.688q0-1.664 1.152-2.688 1.152-1.152 2.688-1.152h7.04V16.384q0-1.536 1.024-2.688 1.152-1.152 2.816-1.152 1.536 0 2.688 1.152t1.152 2.688V39.04zM435.029 18.048q-2.56 0-4.224-1.664-1.664-1.665-1.664-4.096 0-2.304 1.664-3.968 1.793-1.665 4.224-1.664 2.304 0 3.84 1.664 1.664 1.536 1.664 3.968t-1.664 4.096q-1.536 1.665-3.84 1.664m0 86.656q-1.536 0-2.688-1.152-1.152-1.024-1.152-2.56l.384-26.368.384-21.632q.128-2.431-1.024-4.992-1.152-2.688-2.56-3.456-1.536-1.024-2.432-1.792-.768-.768-.768-1.92 0-1.665 1.28-2.56a4.58 4.58 0 0 1 2.944-1.024q4.48 0 7.296 4.096 2.944 3.968 2.944 10.752 0 6.912-.256 18.816-.128 11.904-.256 18.176l-.256 11.904q0 1.663-1.152 2.688a3.92 3.92 0 0 1-2.688 1.024M386.088 104.576q-7.168 0-14.848-3.84-7.552-3.967-11.264-9.856a3.8 3.8 0 0 1-.512-1.92q0-1.664 1.024-2.688 1.152-1.152 2.816-1.152 2.176 0 3.2 1.792 2.432 4.48 8.064 7.424 5.76 2.816 11.52 2.816 7.936 0 12.544-2.432 4.736-2.56 4.736-7.04 0-4.224-3.968-7.296t-13.824-6.656q-9.857-3.585-16.128-7.808-6.144-4.352-6.144-11.776 0-4.864 3.072-8.704 3.2-3.968 8.448-6.144 5.376-2.304 11.776-2.304 8.448 0 14.976 3.84 6.656 3.712 9.216 9.856.256.512.256 1.664 0 1.792-1.024 2.816t-2.688 1.024q-1.024 0-2.048-.512a5.8 5.8 0 0 1-1.536-1.664q-1.92-4.224-6.656-6.912t-10.752-2.688q-6.656 0-11.008 2.816-4.352 2.688-4.352 6.912t4.736 7.296q4.865 2.944 13.056 5.504 11.904 3.84 17.024 8.448 5.248 4.608 5.248 12.288 0 7.936-6.656 12.416t-18.304 4.48M321.778 36.224q9.089 0 16.512 4.48 7.424 4.352 11.648 12.032t4.224 17.152q0 9.855-4.224 17.92-4.224 7.936-11.648 12.544-7.424 4.48-16.64 4.48-7.424 0-13.696-3.712-6.144-3.84-10.24-10.368-.512 40.576-.64 44.416 0 1.536-1.152 2.688-1.024 1.152-2.816 1.152-1.536 0-2.688-1.152a3.92 3.92 0 0 1-1.024-2.688l1.024-82.176q0-2.431-1.28-4.992-1.152-2.688-2.56-3.456-1.536-1.024-2.432-1.792a3.06 3.06 0 0 1-.768-2.048q0-1.665 1.28-2.56 1.28-.896 2.944-.896 3.968 0 6.784 3.328 2.944 3.2 3.584 8.96 4.096-6.144 10.24-9.728 6.272-3.584 13.568-3.584m-.128 60.928q7.04 0 12.672-3.584t8.832-9.728q3.328-6.272 3.328-13.952 0-7.425-3.328-13.312-3.2-5.887-8.832-9.216-5.632-3.456-12.672-3.456-6.784 0-12.16 3.456-5.376 3.328-8.448 9.216t-3.072 13.312q0 7.808 3.072 14.08 3.072 6.144 8.448 9.728 5.376 3.456 12.16 3.456M275.15 98.176q1.536.896 2.432 1.792.896.768.896 1.92 0 1.664-1.28 2.56t-3.072.896q-4.608 0-7.552-4.224t-2.816-11.392l.256-25.856q0-9.089-4.096-13.952-3.968-4.864-11.904-4.864-8.064 0-12.928 5.12t-5.632 13.056q0 6.784-.128 20.608-.128 13.696-.256 16.128a3.72 3.72 0 0 1-1.28 2.56q-1.152.896-2.688.896-1.663 0-2.688-1.024-1.024-1.024-1.024-2.432.128-3.967.256-17.664.128-13.696.128-19.968 0-7.808-4.224-12.544-4.096-4.864-10.88-4.864-7.807 0-13.056 4.864-5.248 4.865-6.272 12.288l-.768 37.888q0 1.663-1.152 2.688-1.152 1.024-2.816 1.024a3.92 3.92 0 0 1-2.688-1.024 3.92 3.92 0 0 1-1.024-2.688l.896-46.976q0-2.431-1.152-4.992-1.152-2.688-2.56-3.456-1.536-1.024-2.432-1.792a3.06 3.06 0 0 1-.768-2.048q0-1.665 1.28-2.56 1.28-.896 2.944-.896 3.712 0 6.4 2.944 2.688 2.816 3.584 7.936 3.584-5.12 8.832-7.808 5.376-2.688 11.136-2.688 6.784 0 12.16 3.712t7.936 10.112q3.328-6.655 8.96-10.24t12.288-3.584q11.136 0 17.152 6.912 6.144 6.784 6.144 19.072l-.256 25.984q0 2.432 1.152 5.12t2.56 3.456M143.486 37.957c1.42 1.196 1.617 3.333.407 4.754l-7.171 8.535 30.009 35.677a6.75 6.75 0 0 1 1.589 4.345v6.652a5.623 5.623 0 0 1-5.625 5.625h-60.75a5.623 5.623 0 0 1-5.625-5.625v-6.652c0-1.589.563-3.121 1.59-4.345l30.008-35.677-7.171-8.535a3.38 3.38 0 0 1 .407-4.754 3.383 3.383 0 0 1 4.754.408l6.412 7.636 6.413-7.622c1.195-1.42 3.332-1.617 4.753-.407zM103.07 91.268v5.527h8.888l2.151-2.306 15.75-16.875a3.34 3.34 0 0 1 2.461-1.07c.928 0 1.828.395 2.461 1.07l15.75 16.875 2.151 2.306h8.888v-5.527l-29.25-34.79zm18.113 5.527h22.26L132.306 84.87l-11.138 11.925zM80.512 85.76q1.025-1.152 2.688-1.152 1.536 0 2.688 1.152 1.152 1.025 1.152 2.688 0 1.536-1.28 2.816-6.144 6.272-16 9.856-9.728 3.456-19.712 3.456-14.208 0-25.6-6.528-11.392-6.655-17.92-18.432T0 52.864t6.528-27.008q6.528-12.16 17.92-18.944Q35.84 0 50.048 0q22.144 0 34.56 14.08 1.28 1.408 1.28 2.944t-1.152 2.688-2.816 1.152-2.688-1.152q-5.376-6.272-12.672-8.96-7.296-2.816-16.512-2.816-11.904 0-21.632 5.76-9.6 5.76-15.104 16-5.376 10.24-5.376 23.168 0 12.8 5.376 22.784 5.505 9.984 15.104 15.488 9.6 5.505 21.632 5.504 10.112 0 18.176-2.688t12.288-8.192"/></svg>
36
+ </a>
37
+ {{>navbar}}
38
+ </header>
39
+ <main class="mx-auto max-w-5xl px-4 sm:px-6 lg:px-8">
40
+ <div
41
+ class="rounded-lg bg-white/5 shadow dark:bg-gray-800/50 dark:shadow-none dark:outline dark:outline-1 dark:-outline-offset-1 dark:outline-white/10 text-white">
42
+ <article class="px-4 py-5 sm:p-6">
43
+ {{#content}}
44
+ {{{content}}}
45
+ {{/content}}
46
+ {{^content}}
47
+ <section>
48
+ <p>Campfire ready</p>
49
+ <h1>Welcome to CampsiteJS</h1>
50
+ <p>Edit <code>src/pages/index.md</code> to get started.</p>
51
+ </section>
52
+ {{/content}}
53
+ </article>
54
+ </div>
55
+ </main>
56
+ <footer class="text-xs text-amber-50/40 text-center">
57
+ <p><span class="font-semibold text-amber-50/60">CampsiteJS</span> built with ā¤ļø by: <a href="https://foxgrovemedia.com" class="text-amber-500 hover:text-white">Fox Grove Media</a>.</p>
58
+ </footer>
59
+ </body>
60
+ </html>
@@ -0,0 +1,9 @@
1
+ ---
2
+ title: 404 - Page Not Found
3
+ layout: base.mustache
4
+ description: This page could not be found.
5
+ ---
6
+
7
+ <h1>404 - Page Not Found</h1>
8
+ <p>The page you're looking for doesn't exist.</p>
9
+ <p><a href="/" class="text-amber-500 hover:text-white">Head back to camp →</a></p>
@@ -10,7 +10,7 @@ description: Cozy, fast static sites with CampsiteJS.
10
10
  <ul>
11
11
  <li>Edit <code>src/pages/index.liquid</code> to make it yours.</li>
12
12
  <li>Tweak the layout in <code>src/layouts/base.liquid</code>.</li>
13
- <li>Add data under <code>src/data/</code>, components in <code>src/components/</code>, and partials in <code>src/partials/</code>.</li>
13
+ <li>Add data under <code>src/collections/</code>, components in <code>src/components/</code>, and partials in <code>src/partials/</code>.</li>
14
14
  </ul>
15
15
 
16
16
  <p>Happy camping! šŸŒ²šŸ•ļøšŸ”„</p>
@@ -0,0 +1,16 @@
1
+ ---
2
+ title: Welcome to CampsiteJS
3
+ layout: base.mustache
4
+ description: Cozy, fast static sites with CampsiteJS.
5
+ ---
6
+
7
+ <h1>Welcome, camper!</h1>
8
+
9
+ <p>CampsiteJS sets up a warm starter for Markdown, Nunjucks, Liquid, Mustache, Vue, and Alpine.</p>
10
+ <ul>
11
+ <li>Edit <code>src/pages/index.mustache</code> to make it yours.</li>
12
+ <li>Tweak the layout in <code>src/layouts/base.mustache</code>.</li>
13
+ <li>Add data under <code>src/collections/</code>, components in <code>src/components/</code>, and partials in <code>src/partials/</code>.</li>
14
+ </ul>
15
+
16
+ <p>Happy camping! šŸŒ²šŸ•ļøšŸ”„</p>
@@ -10,7 +10,7 @@ description: Cozy, fast static sites with CampsiteJS.
10
10
  <ul>
11
11
  <li>Edit <code>src/pages/index.njk</code> to make it yours.</li>
12
12
  <li>Tweak the layout in <code>src/layouts/base.njk</code>.</li>
13
- <li>Add data under <code>src/data/</code>, components in <code>src/components/</code>, and partials in <code>src/partials/</code>.</li>
13
+ <li>Add data under <code>src/collections/</code>, components in <code>src/components/</code>, and partials in <code>src/partials/</code>.</li>
14
14
  </ul>
15
15
 
16
16
  <p>Happy camping! šŸŒ²šŸ•ļøšŸ”„</p>
@@ -0,0 +1,8 @@
1
+ <nav class="flex items-center gap-2">
2
+ {{#navbar}}
3
+ <a href="{{url}}" {{#target}}target="{{target}}"{{/target}} {{#rel}}rel="{{rel}}"{{/rel}} class="px-2 {{#active}}active{{/active}}{{^active}}not-active{{/active}} {{class}}">
4
+ {{#label}}{{label}}{{/label}}
5
+ {{#svg}}{{{svg}}}{{/svg}}
6
+ </a>
7
+ {{/navbar}}
8
+ </nav>
@@ -1,5 +1,5 @@
1
1
  <nav class="flex items-center gap-2">
2
- {% set nav_items = navbar or data.navbar or [] %}
2
+ {% set nav_items = navbar or collections.navbar or [] %}
3
3
  {% for item in nav_items %}
4
4
  <a href="{{ item.url or '#' }}" {% if item.target %}target="{{ item.target }}" {% endif %} {% if item.rel
5
5
  %}rel="{{ item.rel }}" {% endif %}