nibula 2.0.2 → 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.
@@ -17,7 +17,7 @@ your-project/
17
17
  └── frontend/
18
18
  ├── assets/ # Images, fonts, brand files
19
19
  │ └── brand/ # Favicons, logo etc
20
- ├── components/ # Reusable .njk fragments
20
+ ├── components/ # Reusable .njk fragments and .md content
21
21
  │ └── global/ # Header and footer, included in every page
22
22
  ├── data/ # site.json and pages.json
23
23
  ├── hosting/ # .htaccess and web.config
@@ -35,6 +35,7 @@ your-project/
35
35
  | Add a page | `nib cli` → creates the files in `routes/`, `scss/pages/`, `js/pages/` |
36
36
  | Write the content of a page | `routes/` |
37
37
  | Build a reusable block of markup | `components/` |
38
+ | Write long prose in Markdown | `components/` — see docs/Components.md |
38
39
  | Change the header or footer | `components/global/` |
39
40
  | Style one page | `scss/pages/` |
40
41
  | Style every page | `scss/_global.scss` |
@@ -57,7 +58,7 @@ your-project/
57
58
 
58
59
  Subfolders are allowed wherever content is yours to organize:
59
60
 
60
- - `components/` — nest as deep as you like; includes take the path relative to `components/`
61
+ - `components/` — nest as deep as you like; includes take the path relative to `components/`, and so does the `markdownPath` filter
61
62
  - `scss/modules/` and `js/modules/` — same idea, remember to update the relative import paths
62
63
  - `layouts/` — extra layouts alongside `base.njk`; routes pick one by filename
63
64
  - `backend/api/public/` and `protected/` — subfolders become part of the URL
@@ -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.0.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",
@@ -63,6 +63,8 @@
63
63
  "esbuild": "^0.27.3",
64
64
  "foundation-sites": "^6.9.0",
65
65
  "glob": "^13.0.6",
66
+ "markdown-it-anchor": "^9.2.1",
67
+ "markdown-it-attrs": "^5.0.1",
66
68
  "sass": "^1.77.0",
67
69
  "uikit": "^3.25.13"
68
70
  }
@@ -1,4 +1,4 @@
1
- <!-- This is the base of every page that you will create -->
1
+ {# This is the base of every page that you will create #}
2
2
 
3
3
  <!DOCTYPE html>
4
4
  <html lang="{{ site.lang or 'en' }}" data-theme="{{ site.theme or 'light' }}" data-bs-theme="{{ site.theme or 'light' }}">
@@ -4,7 +4,12 @@ permalink: "404.html"
4
4
  layout: base.njk
5
5
  ---
6
6
 
7
- <!-- !IMPORTANT -->
8
- <!-- To keep order, the best practice is to create a new component.njk file in components/ and include it here-->
7
+ {# To keep order, create a new component in components/ and include it here #}
8
+ {% include "not-found.njk" ignore missing %}
9
9
 
10
- {% include "not-found.njk" ignore missing %}
10
+ {# Markdown files live in components/ too. Pass the data the file needs #}
11
+ {#
12
+ <article class="markdown-body">
13
+ {% renderFile "your-file.md" | markdownPath, { site: site } %}
14
+ </article>
15
+ #}
@@ -4,7 +4,12 @@ permalink: "/"
4
4
  layout: base.njk
5
5
  ---
6
6
 
7
- <!-- !IMPORTANT -->
8
- <!-- To keep order, the best practice is to create a new component.njk file in components/ and include it here-->
7
+ {# To keep order, create a new component in components/ and include it here #}
8
+ {% include "welcome.njk" ignore missing %}
9
9
 
10
- {% include "welcome.njk" ignore missing %}
10
+ {# Markdown files live in components/ too. Pass the data the file needs #}
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