nibula 2.2.1 → 2.3.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/.eleventy.js +18 -5
- package/CHANGELOG.md +17 -0
- package/bin/create.js +1 -0
- package/docs/Components.md +2 -3
- package/package.json +2 -1
- package/src/frontend/layouts/base.njk +3 -0
- package/src/frontend/routes/404.njk +1 -1
- package/src/frontend/routes/index.njk +1 -1
- package/tools/res/templates/template.njk +1 -1
package/.eleventy.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const { RenderPlugin } = require("@11ty/eleventy");
|
|
2
2
|
const markdownItAnchor = require("markdown-it-anchor");
|
|
3
3
|
const markdownItAttrs = require("markdown-it-attrs");
|
|
4
|
+
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
|
|
4
5
|
const Image = require("@11ty/eleventy-img");
|
|
5
6
|
const fs = require("fs");
|
|
6
7
|
const path = require("path");
|
|
@@ -14,7 +15,6 @@ const ANCHOR_PERMALINK_PLACEMENT = "after";
|
|
|
14
15
|
const MARKDOWN_BASE_PATH = "src/frontend/components/";
|
|
15
16
|
|
|
16
17
|
module.exports = function (eleventyConfig) {
|
|
17
|
-
|
|
18
18
|
// ---------------------------------------------------------------------------
|
|
19
19
|
// Utilities
|
|
20
20
|
// ---------------------------------------------------------------------------
|
|
@@ -42,6 +42,10 @@ module.exports = function (eleventyConfig) {
|
|
|
42
42
|
|
|
43
43
|
eleventyConfig.addPlugin(RenderPlugin);
|
|
44
44
|
|
|
45
|
+
eleventyConfig.addPlugin(syntaxHighlight, {
|
|
46
|
+
templateFormats: ["md"],
|
|
47
|
+
});
|
|
48
|
+
|
|
45
49
|
eleventyConfig.amendLibrary("md", (markdownLibrary) => {
|
|
46
50
|
markdownLibrary
|
|
47
51
|
.use(markdownItAnchor, {
|
|
@@ -76,10 +80,16 @@ module.exports = function (eleventyConfig) {
|
|
|
76
80
|
"src/frontend/hosting/web.config": "web.config",
|
|
77
81
|
});
|
|
78
82
|
|
|
79
|
-
//
|
|
83
|
+
// Prism syntax highlighting theme
|
|
84
|
+
eleventyConfig.addPassthroughCopy({
|
|
85
|
+
"node_modules/prismjs/themes/prism-tomorrow.css": "css/prism.css",
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// CSS frameworks — uncomment the one you are using
|
|
80
89
|
eleventyConfig.addPassthroughCopy({
|
|
81
90
|
// Bootstrap
|
|
82
|
-
"node_modules/bootstrap/dist/js/bootstrap.bundle.min.js":
|
|
91
|
+
"node_modules/bootstrap/dist/js/bootstrap.bundle.min.js":
|
|
92
|
+
"js/bootstrap.bundle.min.js",
|
|
83
93
|
"node_modules/bootstrap-icons/font/fonts": "css/fonts",
|
|
84
94
|
|
|
85
95
|
// Foundation
|
|
@@ -96,7 +106,10 @@ module.exports = function (eleventyConfig) {
|
|
|
96
106
|
// Shortcodes
|
|
97
107
|
// ---------------------------------------------------------------------------
|
|
98
108
|
|
|
99
|
-
eleventyConfig.addFilter(
|
|
109
|
+
eleventyConfig.addFilter(
|
|
110
|
+
"markdownPath",
|
|
111
|
+
(name) => `${MARKDOWN_BASE_PATH}${name}`,
|
|
112
|
+
);
|
|
100
113
|
|
|
101
114
|
eleventyConfig.addShortcode("image", async function (src, alt) {
|
|
102
115
|
const metadata = await Image(src, {
|
|
@@ -143,4 +156,4 @@ module.exports = function (eleventyConfig) {
|
|
|
143
156
|
data: "data",
|
|
144
157
|
},
|
|
145
158
|
};
|
|
146
|
-
};
|
|
159
|
+
};
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ 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.3.0] - 2026-08-19
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Code blocks in Markdown are syntax highlighted.** `@11ty/eleventy-plugin-syntaxhighlight`
|
|
12
|
+
runs PrismJS at build time — no client-side JavaScript — and a Prism theme is
|
|
13
|
+
copied to `css/prism.css` and linked in `base.njk`. Adding a language to the
|
|
14
|
+
fence (```` ```json ````) colours the block; leaving the fence bare renders it
|
|
15
|
+
plain, which is what you want for a command meant to be copied.
|
|
16
|
+
|
|
17
|
+
## [2.2.2] - 2026-08-19
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
- The commented `renderFile` example in the page template now passes `"md"` as
|
|
21
|
+
the format argument. Without it Eleventy also ran the file through Nunjucks, so
|
|
22
|
+
a `.md` containing template syntax — a code sample with `{{ }}` or `{% %}` in
|
|
23
|
+
it — broke the build instead of rendering as text.
|
|
24
|
+
|
|
8
25
|
## [2.2.1] - 2026-08-18
|
|
9
26
|
|
|
10
27
|
### Fixed
|
package/bin/create.js
CHANGED
package/docs/Components.md
CHANGED
|
@@ -13,8 +13,6 @@ src/frontend/components/
|
|
|
13
13
|
├── global/
|
|
14
14
|
│ ├── header.njk
|
|
15
15
|
│ └── footer.njk
|
|
16
|
-
├── modals/
|
|
17
|
-
│ └── privacyModal.njk
|
|
18
16
|
├── not-found.njk
|
|
19
17
|
├── welcome.njk
|
|
20
18
|
```
|
|
@@ -88,7 +86,7 @@ Open the page's file in `src/frontend/routes/` and add this line to its body:
|
|
|
88
86
|
|
|
89
87
|
```html
|
|
90
88
|
<article class="markdown-body">
|
|
91
|
-
{% renderFile "article.md" | markdownPath, { site: site } %}
|
|
89
|
+
{% renderFile "article.md" | markdownPath, { site: site }, "md" %}
|
|
92
90
|
</article>
|
|
93
91
|
```
|
|
94
92
|
|
|
@@ -100,6 +98,7 @@ Four parts to it:
|
|
|
100
98
|
| `renderFile` | turns the Markdown into HTML and puts it in the page |
|
|
101
99
|
| `markdownPath` | fills in the `src/frontend/components/` part of the path for you |
|
|
102
100
|
| `{ site: site }` | hands the file your site settings — see below |
|
|
101
|
+
| `"md"` | specifies that the rendering should be done as Markdown, ignoring the njk engine associated by default with the file extension |
|
|
103
102
|
|
|
104
103
|
Subfolders work the same way as with components:
|
|
105
104
|
`"legal/privacy.md" | markdownPath`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nibula",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.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",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@11ty/eleventy": "^3.1.2",
|
|
58
58
|
"@11ty/eleventy-img": "^6.0.4",
|
|
59
|
+
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.2",
|
|
59
60
|
"bootstrap": "^5.3.8",
|
|
60
61
|
"bootstrap-icons": "^1.13.1",
|
|
61
62
|
"bulma": "^1.0.4",
|
|
@@ -10,6 +10,6 @@ layout: base.njk
|
|
|
10
10
|
{# Markdown files live in components/ too. Pass the data the file needs #}
|
|
11
11
|
{#
|
|
12
12
|
<article class="markdown-body">
|
|
13
|
-
{% renderFile "your-file.md" | markdownPath, { site: site } %}
|
|
13
|
+
{% renderFile "your-file.md" | markdownPath, { site: site }, "md" %}
|
|
14
14
|
</article>
|
|
15
15
|
#}
|
|
@@ -10,6 +10,6 @@ layout: base.njk
|
|
|
10
10
|
{# Markdown files live in components/ too. Pass the data the file needs #}
|
|
11
11
|
{#
|
|
12
12
|
<article class="markdown-body">
|
|
13
|
-
{% renderFile "your-file.md" | markdownPath, { site: site } %}
|
|
13
|
+
{% renderFile "your-file.md" | markdownPath, { site: site }, "md" %}
|
|
14
14
|
</article>
|
|
15
15
|
#}
|
|
@@ -10,6 +10,6 @@ layout: base.njk
|
|
|
10
10
|
{# Markdown files live in components/ too. Pass the data the file needs #}
|
|
11
11
|
{#
|
|
12
12
|
<article class="markdown-body">
|
|
13
|
-
{% renderFile "your-file.md" | markdownPath, { site: site } %}
|
|
13
|
+
{% renderFile "your-file.md" | markdownPath, { site: site }, "md" %}
|
|
14
14
|
</article>
|
|
15
15
|
#}
|