nibula 2.4.7 → 2.5.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,11 @@ All notable changes to Nibula are documented here.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.5.0] - 2026-09-??
9
+
10
+ ### Changed
11
+ - The data record a new page gets in `pages.json` comes from `tools/res/templates/template.json` instead of being written inside `settings.json`. It's content, like the route, the stylesheet and the script, and it now sits with the other three templates rather than in the CLI's configuration.
12
+
8
13
  ## [2.4.7] - 2026-09-04
9
14
 
10
15
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nibula",
3
- "version": "2.4.7",
3
+ "version": "2.5.0",
4
4
  "description": "A beginner-friendly static site generator built on Eleventy that stays close to vanilla HTML, CSS and JS — with a page-management CLI, an optional PHP backend, and SEO files generated for you.",
5
5
  "keywords": [
6
6
  "11ty",
@@ -71,19 +71,7 @@
71
71
  "styleTemplate": "template.scss",
72
72
  "routeTemplate": "template.njk",
73
73
  "layoutExtension": "njk",
74
- "defaultData": {
75
- "seo": {
76
- "title": "{title}",
77
- "description": "Description",
78
- "keywords": "",
79
- "noindex": false,
80
- "canonical": ""
81
- },
82
- "cdn": {
83
- "css": [],
84
- "js": []
85
- }
86
- }
74
+ "dataTemplate": "template.json"
87
75
  },
88
76
  "frontMatter": {
89
77
  "title": "title: \"{camelName}\"",
@@ -1,7 +1,7 @@
1
1
  const path = require('path');
2
2
  const settings = require('../config/settings.json');
3
3
  const { PATHS } = require('./paths');
4
- const { exists, readText, writeJson } = require('./files');
4
+ const { exists, readText, readJson, writeJson } = require('./files');
5
5
  const { log } = require('./logger');
6
6
  const { toCamelCase, toTitleCase, formatValue } = require('./text');
7
7
 
@@ -28,7 +28,14 @@ function writePagesData(data) {
28
28
  }
29
29
 
30
30
  function createRecord(pageName) {
31
- return formatValue(settings.page.defaultData, { title: toTitleCase(pageName) });
31
+ const templateFile = path.join(PATHS.templates, settings.page.dataTemplate);
32
+
33
+ if (!exists(templateFile)) {
34
+ log('page.templateMissing', { path: templateFile });
35
+ return null;
36
+ }
37
+
38
+ return formatValue(readJson(templateFile), { title: toTitleCase(pageName) });
32
39
  }
33
40
 
34
41
  function addPageData(pageName) {
@@ -41,7 +48,10 @@ function addPageData(pageName) {
41
48
  return;
42
49
  }
43
50
 
44
- data[camelName] = createRecord(pageName);
51
+ const record = createRecord(pageName);
52
+ if (!record) return;
53
+
54
+ data[camelName] = record;
45
55
 
46
56
  writePagesData(data);
47
57
  log('pagesData.recordAdded', { name: camelName });