nibula 2.1.0 → 2.2.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 +29 -0
- package/docs/Components.md +12 -9
- package/docs/Creating pages.md +1 -1
- package/docs/Head and SEO.md +1 -1
- package/docs/Styling with SCSS.md +3 -0
- package/package.json +1 -1
- package/src/frontend/routes/404.njk +5 -1
- package/src/frontend/routes/index.njk +5 -1
- package/src/frontend/scss/_global.scss +3 -0
- package/src/frontend/scss/modules/_markdown.scss +1598 -0
- package/tools/res/templates/template.njk +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,35 @@ 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.0] - 2026-08-18
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Markdown rendered with `renderFile` is styled out of the box.**
|
|
12
|
+
`src/frontend/scss/modules/_markdown.scss` carries GitHub's Markdown layout —
|
|
13
|
+
tables, code blocks, blockquotes, heading spacing — scoped to a
|
|
14
|
+
`.markdown-body` container. Markdown produces plain HTML with no classes, so a
|
|
15
|
+
rendered `.md` came out as unstyled text regardless of the CSS framework in the
|
|
16
|
+
project. Colours follow `data-theme`, and the background is transparent so the
|
|
17
|
+
block sits on the page instead of on a panel of its own.
|
|
18
|
+
- The commented `renderFile` example in the route template now shows the
|
|
19
|
+
`.markdown-body` wrapper, which is what applies the styling.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- `docs/Components.md` documents the wrapper as part of the `renderFile` line,
|
|
23
|
+
and no longer says Markdown comes out unstyled: `{.class}` is now for adding
|
|
24
|
+
your framework's classes to specific elements, not for making the content
|
|
25
|
+
presentable in the first place.
|
|
26
|
+
- `docs/Styling with SCSS.md` lists `_markdown.scss` among the pre-existing
|
|
27
|
+
modules, noting that it is generated rather than hand-written and that its
|
|
28
|
+
import has to stay after the framework for its table and code block rules to
|
|
29
|
+
win.
|
|
30
|
+
|
|
31
|
+
### Notes
|
|
32
|
+
- The styling lands in newly created projects only. To adopt it in an existing
|
|
33
|
+
one, copy `src/frontend/scss/modules/_markdown.scss` and import it in
|
|
34
|
+
`_global.scss` after the framework, then wrap your `renderFile` calls in
|
|
35
|
+
`<article class="markdown-body">`.
|
|
36
|
+
|
|
8
37
|
## [2.1.0] - 2026-08-17
|
|
9
38
|
|
|
10
39
|
### Added
|
package/docs/Components.md
CHANGED
|
@@ -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
|
-
```
|
|
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
|
-
```
|
|
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
|
-
```
|
|
90
|
-
|
|
89
|
+
```html
|
|
90
|
+
<article class="markdown-body">
|
|
91
|
+
{% renderFile "article.md" | markdownPath, { site: site } %}
|
|
92
|
+
</article>
|
|
91
93
|
```
|
|
92
94
|
|
|
93
|
-
|
|
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
|
-
```
|
|
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
|
-
```
|
|
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
|
-
```
|
|
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
|
-
```
|
|
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 }}">
|
package/docs/Creating pages.md
CHANGED
|
@@ -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
|
-
```
|
|
38
|
+
```js
|
|
39
39
|
---
|
|
40
40
|
title: "team"
|
|
41
41
|
permalink: "/about/team/"
|
package/docs/Head and SEO.md
CHANGED
|
@@ -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
|
-
```
|
|
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.
|
|
3
|
+
"version": "2.2.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",
|
|
@@ -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
|
-
{#
|
|
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
|
-
{#
|
|
11
|
+
{#
|
|
12
|
+
<article class="markdown-body">
|
|
13
|
+
{% renderFile "your-file.md" | markdownPath, { site: site } %}
|
|
14
|
+
</article>
|
|
15
|
+
#}
|