nibula 2.1.0 → 2.2.1

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,50 @@ 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.2.1] - 2026-08-18
9
+
10
+ ### Fixed
11
+ - Renaming a page left the old `title` in the route's front matter. Only
12
+ `permalink` was rewritten, so a page renamed from `about` to `company` kept
13
+ `title: "about"` while its stylesheet, script and `pages.json` record had all
14
+ moved to `company`. The title is what the layout uses to load a page's CSS and
15
+ JS and to look up its SEO record, so the renamed page silently lost its styles,
16
+ its scripts and everything set under its `pages.json` entry.
17
+
18
+ ### Notes
19
+ - Pages renamed with an earlier version keep the stale title. Open the route in
20
+ `src/frontend/routes/` and set `title` to the camelCase form of the new page
21
+ name — `company-profile` becomes `companyProfile`.
22
+
23
+ ## [2.2.0] - 2026-08-18
24
+
25
+ ### Added
26
+ - **Markdown rendered with `renderFile` is styled out of the box.**
27
+ `src/frontend/scss/modules/_markdown.scss` carries GitHub's Markdown layout —
28
+ tables, code blocks, blockquotes, heading spacing — scoped to a
29
+ `.markdown-body` container. Markdown produces plain HTML with no classes, so a
30
+ rendered `.md` came out as unstyled text regardless of the CSS framework in the
31
+ project. Colours follow `data-theme`, and the background is transparent so the
32
+ block sits on the page instead of on a panel of its own.
33
+ - The commented `renderFile` example in the route template now shows the
34
+ `.markdown-body` wrapper, which is what applies the styling.
35
+
36
+ ### Changed
37
+ - `docs/Components.md` documents the wrapper as part of the `renderFile` line,
38
+ and no longer says Markdown comes out unstyled: `{.class}` is now for adding
39
+ your framework's classes to specific elements, not for making the content
40
+ presentable in the first place.
41
+ - `docs/Styling with SCSS.md` lists `_markdown.scss` among the pre-existing
42
+ modules, noting that it is generated rather than hand-written and that its
43
+ import has to stay after the framework for its table and code block rules to
44
+ win.
45
+
46
+ ### Notes
47
+ - The styling lands in newly created projects only. To adopt it in an existing
48
+ one, copy `src/frontend/scss/modules/_markdown.scss` and import it in
49
+ `_global.scss` after the framework, then wrap your `renderFile` calls in
50
+ `<article class="markdown-body">`.
51
+
8
52
  ## [2.1.0] - 2026-08-17
9
53
 
10
54
  ### Added
@@ -25,7 +25,7 @@ Components are included in the page that renders them. Open the page's file in `
25
25
 
26
26
  ### example-page.njk <small>(`src/frontend/routes/`)</small>
27
27
 
28
- ```njk
28
+ ```js
29
29
  ---
30
30
  title: "examplePage"
31
31
  permalink: "/example-page/"
@@ -49,7 +49,7 @@ Writing HTML directly in the route works too, and is perfectly fine for a short
49
49
  A component can include other components. This is useful for breaking complex sections into smaller, reusable pieces.
50
50
 
51
51
  ### exampleComponent.njk
52
- ```njk
52
+ ```html
53
53
  <section class="hero">
54
54
  {% include "hero/hero-title.njk" %}
55
55
  {% include "hero/hero-button.njk" %}
@@ -86,14 +86,17 @@ Regular paragraph text. **Bold** and *italic* work as usual.
86
86
 
87
87
  Open the page's file in `src/frontend/routes/` and add this line to its body:
88
88
 
89
- ```njk
90
- {% renderFile "article.md" | markdownPath, { site: site } %}
89
+ ```html
90
+ <article class="markdown-body">
91
+ {% renderFile "article.md" | markdownPath, { site: site } %}
92
+ </article>
91
93
  ```
92
94
 
93
- Three parts to it:
95
+ Four parts to it:
94
96
 
95
97
  | Part | What it does |
96
98
  |---|---|
99
+ | `class="markdown-body"` | the wrapper that applies the Markdown styling — without it your content renders unstyled |
97
100
  | `renderFile` | turns the Markdown into HTML and puts it in the page |
98
101
  | `markdownPath` | fills in the `src/frontend/components/` part of the path for you |
99
102
  | `{ site: site }` | hands the file your site settings — see below |
@@ -112,7 +115,7 @@ Welcome to {{ site.title }}
112
115
  But a Markdown file does not automatically see them. Anything the file needs has
113
116
  to be listed in the curly braces:
114
117
 
115
- ```njk
118
+ ```js
116
119
  {% renderFile "article.md" | markdownPath, { site: site, pages: pages } %}
117
120
  ```
118
121
 
@@ -160,7 +163,7 @@ src/frontend/layouts/
160
163
 
161
164
  Same as `base.njk`, without the two global includes:
162
165
 
163
- ```njk
166
+ ```html
164
167
  <body>
165
168
  <main>
166
169
  {{ content | safe }}
@@ -172,7 +175,7 @@ Then point the route at it:
172
175
 
173
176
  ### landing.njk <small>(`src/frontend/routes/`)</small>
174
177
 
175
- ```njk
178
+ ```js
176
179
  ---
177
180
  title: "landing"
178
181
  permalink: "/landing/"
@@ -218,7 +221,7 @@ All values defined in `src/frontend/data/site.json` are globally available in ev
218
221
  `legal.privacy`, `legal.cookie` and `legal.terms` hold the URLs of your legal pages — the footer links to them. See **Head & SEO** DOC file for what every field does
219
222
 
220
223
  ### Usage in any `.njk` file
221
- ```njk
224
+ ```html
222
225
  <p>{{ site.title }}</p>
223
226
  <a href="{{ site.legal.privacy }}">Privacy Policy</a>
224
227
  <img src="{{ site.logo }}" alt="{{ site.title }}">
@@ -35,7 +35,7 @@ A page that needs a different shell — a landing page with no header, for insta
35
35
 
36
36
  To create a URL like `domain.it/about/team`, edit the `permalink` in `src/frontend/routes/team.njk` and add the parent segment before the final slash:
37
37
 
38
- ```njk
38
+ ```js
39
39
  ---
40
40
  title: "team"
41
41
  permalink: "/about/team/"
@@ -116,7 +116,7 @@ aren't things you'd want.
116
116
 
117
117
  One value in `site.json` controls the colour scheme everywhere:
118
118
 
119
- ```njk
119
+ ```html
120
120
  <html data-theme="{{ site.theme }}" data-bs-theme="{{ site.theme }}">
121
121
  <meta name="color-scheme" content="{{ site.theme }}">
122
122
  <meta name="theme-color" content="{{ site.theme_color }}">
@@ -78,6 +78,9 @@ body {
78
78
  | `_footer.scss` | Footer styles |
79
79
  | `_mobile.scss` | Media query rules |
80
80
  | `_animations.scss` | Keyframe animations (`fade-in`, `spin`) |
81
+ | `_markdown.scss` | Styling for Markdown rendered with `renderFile`. See **Components** DOC file |
82
+
83
+ > If you don't use Markdown files as components, comment its import from `_global.scss`.
81
84
 
82
85
  ## CSS Framework
83
86
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nibula",
3
- "version": "2.1.0",
3
+ "version": "2.2.1",
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",
@@ -8,4 +8,8 @@ layout: base.njk
8
8
  {% include "not-found.njk" ignore missing %}
9
9
 
10
10
  {# Markdown files live in components/ too. Pass the data the file needs #}
11
- {# {% renderFile "example.md" | markdownPath, { site: site } %} #}
11
+ {#
12
+ <article class="markdown-body">
13
+ {% renderFile "your-file.md" | markdownPath, { site: site } %}
14
+ </article>
15
+ #}
@@ -8,4 +8,8 @@ layout: base.njk
8
8
  {% include "welcome.njk" ignore missing %}
9
9
 
10
10
  {# Markdown files live in components/ too. Pass the data the file needs #}
11
- {# {% renderFile "example.md" | markdownPath, { site: site } %} #}
11
+ {#
12
+ <article class="markdown-body">
13
+ {% renderFile "your-file.md" | markdownPath, { site: site } %}
14
+ </article>
15
+ #}
@@ -11,6 +11,9 @@
11
11
  // @import "modules/frameworks/foundation";
12
12
  // @import "modules/frameworks/uikit";
13
13
 
14
+ // Markdown styling. Applies to content rendered with renderFile
15
+ @import "modules/markdown";
16
+
14
17
  // Modules imports
15
18
  @import "modules/typography";
16
19