nibula 1.2.4 → 1.2.5
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 +81 -81
- package/.eleventyignore +3 -3
- package/.github/workflows/publish.yml +37 -0
- package/CHANGELOG.md +166 -148
- package/LICENSE +169 -169
- package/NOTICE +4 -4
- package/README.md +120 -123
- package/bin/create.js +507 -507
- package/bin/nibula.js +317 -305
- package/docs/Assistant CLI.md +65 -65
- package/docs/Backend.md +295 -295
- package/docs/Components.md +84 -84
- package/docs/Creating pages.md +64 -64
- package/docs/Deploy.md +189 -189
- package/docs/Head and SEO.md +138 -138
- package/docs/Javascript.md +50 -50
- package/docs/Styling with SCSS.md +141 -141
- package/nginx.conf +75 -75
- package/package.json +1 -1
- package/src/backend/.htaccess +6 -6
- package/src/backend/_core/composer.json +5 -5
- package/src/backend/_core/composer.lock +492 -492
- package/src/backend/_core/index.js +267 -267
- package/src/backend/_core/index.php +147 -147
- package/src/backend/_core/init.js +52 -52
- package/src/backend/_core/init.php +33 -33
- package/src/backend/_core/modules/RateLimiter.js +58 -58
- package/src/backend/_core/modules/RateLimiter.php +30 -30
- package/src/backend/_core/modules/Response.js +59 -59
- package/src/backend/_core/modules/Response.php +48 -48
- package/src/backend/api/protected/example-protected.js +23 -23
- package/src/backend/api/protected/example-protected.php +16 -16
- package/src/backend/api/public/example-public.js +24 -24
- package/src/backend/api/public/example-public.php +16 -16
- package/src/backend/backend-node.service.example +30 -30
- package/src/backend/database/Database.js +46 -46
- package/src/backend/database/Database.php +23 -23
- package/src/backend/example.config.js +37 -37
- package/src/backend/example.config.php +27 -27
- package/src/backend/package.json +18 -18
- package/src/backend/web.config +16 -16
- package/src/frontend/.htaccess +51 -51
- package/src/frontend/404.njk +17 -17
- package/src/frontend/assets/brand/favicon.svg +54 -54
- package/src/frontend/assets/brand/logo.svg +54 -54
- package/src/frontend/components/global/footer.njk +25 -25
- package/src/frontend/components/global/header.njk +6 -6
- package/src/frontend/components/welcome.njk +114 -114
- package/src/frontend/data/site.json +48 -48
- package/src/frontend/index.njk +8 -8
- package/src/frontend/js/modules/exampleModule.js +2 -2
- package/src/frontend/js/pages/404.js +6 -6
- package/src/frontend/js/pages/homepage.js +6 -6
- package/src/frontend/layouts/base.njk +132 -132
- package/src/frontend/layouts/page-components.njk +13 -13
- package/src/frontend/llms.njk +17 -17
- package/src/frontend/robots.njk +7 -7
- package/src/frontend/scss/modules/_animations.scss +24 -24
- package/src/frontend/scss/modules/_footer.scss +27 -27
- package/src/frontend/scss/modules/_global.scss +47 -47
- package/src/frontend/scss/modules/_header.scss +27 -27
- package/src/frontend/scss/modules/_mobile.scss +29 -29
- package/src/frontend/scss/modules/_root.scss +34 -34
- package/src/frontend/scss/modules/_typography.scss +14 -14
- package/src/frontend/scss/modules/frameworks/_bootstrap.scss +109 -109
- package/src/frontend/scss/modules/frameworks/_bulma.scss +108 -108
- package/src/frontend/scss/modules/frameworks/_foundation.scss +138 -139
- package/src/frontend/scss/modules/frameworks/_uikit.scss +109 -109
- package/src/frontend/scss/pages/404.scss +27 -27
- package/src/frontend/scss/pages/homepage.scss +22 -22
- package/src/frontend/sitemap.njk +17 -17
- package/src/frontend/ts/modules/exampleModule.ts +2 -2
- package/src/frontend/ts/pages/404.ts +6 -6
- package/src/frontend/ts/pages/homepage.ts +6 -6
- package/src/frontend/web.config +55 -55
- package/tools/config/messages.json +3 -1
- package/tools/res/templates/template.js +6 -6
- package/tools/res/templates/template.njk +8 -8
- package/tools/res/templates/template.scss +22 -22
- package/tools/res/templates/template.ts +6 -6
- package/tsconfig.json +24 -24
package/docs/Components.md
CHANGED
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
# Nunjucks (HTML) Components
|
|
2
|
-
|
|
3
|
-
## What is Nunjucks
|
|
4
|
-
|
|
5
|
-
Nunjucks (`.njk`) is an HTML file that supports logic like variables, `if` statements, and `for` loops. It can extend a base layout and include other `.njk` components
|
|
6
|
-
|
|
7
|
-
## Create a component
|
|
8
|
-
|
|
9
|
-
Create a new `.njk` file anywhere inside `src/frontend/components/`. You can organize them into subfolders freely
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
src/frontend/components/
|
|
13
|
-
├── global/
|
|
14
|
-
├── layouts/
|
|
15
|
-
├── modals/
|
|
16
|
-
│ └── privacyModal.njk # You can move it to a modals/subfolder
|
|
17
|
-
├── welcome.njk
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Include a component
|
|
21
|
-
|
|
22
|
-
To render a component inside a page, navigate to `src/frontend/layouts/` and edit `page-components.njk`
|
|
23
|
-
|
|
24
|
-
### page-components.njk <small>(`src/frontend/layouts/`)</small>
|
|
25
|
-
|
|
26
|
-
```js
|
|
27
|
-
{% if title == "homepage" %}
|
|
28
|
-
{% include "welcome.njk" %}
|
|
29
|
-
|
|
30
|
-
{% elif title == "examplePage" %}
|
|
31
|
-
{% include "exampleComponent1.njk" %}
|
|
32
|
-
{% include "subfolder/exampleComponent2.njk" %}
|
|
33
|
-
|
|
34
|
-
{% else %}
|
|
35
|
-
{% include "404/_404.njk" %}
|
|
36
|
-
{{ content | safe }}
|
|
37
|
-
{% endif %}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Add a new `{% elif %}` block for each page, listing its components in order. If a component lives in a subfolder, specify the relative path accordingly
|
|
41
|
-
|
|
42
|
-
> ⚠️ A new `elif` block is automatically added when you create a page via the Assistant CLI
|
|
43
|
-
|
|
44
|
-
> ⚠️ If you move or delete a component, always update `page-components.njk` or the site will break
|
|
45
|
-
|
|
46
|
-
## Nest components
|
|
47
|
-
|
|
48
|
-
A component can include other components. This is useful for breaking complex sections into smaller, reusable pieces.
|
|
49
|
-
|
|
50
|
-
### exampleComponent.njk
|
|
51
|
-
```js
|
|
52
|
-
<section class="hero">
|
|
53
|
-
{% include "ui/heroTitle.njk" %}
|
|
54
|
-
{% include "ui/heroButton.njk" %}
|
|
55
|
-
</section>
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
> The same path rules apply: if the included component is in a subfolder, specify the full relative path.
|
|
59
|
-
|
|
60
|
-
## Global components
|
|
61
|
-
|
|
62
|
-
Header and footer live in `src/frontend/components/global/` and are automatically included in every page via `base.njk`. Edit them to change the site-wide layout
|
|
63
|
-
|
|
64
|
-
## Site data in components
|
|
65
|
-
|
|
66
|
-
All values defined in `src/frontend/data/site.json` are globally available in every component via `{{ site.* }}`
|
|
67
|
-
|
|
68
|
-
### site.json <small>(`src/frontend/data/`)</small>
|
|
69
|
-
```json
|
|
70
|
-
{
|
|
71
|
-
"title": "My Site",
|
|
72
|
-
"theme": "dark",
|
|
73
|
-
"logo": "/assets/brand/logo.svg",
|
|
74
|
-
"legal": {
|
|
75
|
-
"privacy": "/privacy"
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Usage in any `.njk` file
|
|
81
|
-
```js
|
|
82
|
-
<p>{{ site.title }}</p>
|
|
83
|
-
<a href="{{ site.legal.privacy }}">Privacy Policy</a>
|
|
84
|
-
<img src="{{ site.logo }}" alt="{{ site.title }}">
|
|
1
|
+
# Nunjucks (HTML) Components
|
|
2
|
+
|
|
3
|
+
## What is Nunjucks
|
|
4
|
+
|
|
5
|
+
Nunjucks (`.njk`) is an HTML file that supports logic like variables, `if` statements, and `for` loops. It can extend a base layout and include other `.njk` components
|
|
6
|
+
|
|
7
|
+
## Create a component
|
|
8
|
+
|
|
9
|
+
Create a new `.njk` file anywhere inside `src/frontend/components/`. You can organize them into subfolders freely
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
src/frontend/components/
|
|
13
|
+
├── global/
|
|
14
|
+
├── layouts/
|
|
15
|
+
├── modals/
|
|
16
|
+
│ └── privacyModal.njk # You can move it to a modals/subfolder
|
|
17
|
+
├── welcome.njk
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Include a component
|
|
21
|
+
|
|
22
|
+
To render a component inside a page, navigate to `src/frontend/layouts/` and edit `page-components.njk`
|
|
23
|
+
|
|
24
|
+
### page-components.njk <small>(`src/frontend/layouts/`)</small>
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
{% if title == "homepage" %}
|
|
28
|
+
{% include "welcome.njk" %}
|
|
29
|
+
|
|
30
|
+
{% elif title == "examplePage" %}
|
|
31
|
+
{% include "exampleComponent1.njk" %}
|
|
32
|
+
{% include "subfolder/exampleComponent2.njk" %}
|
|
33
|
+
|
|
34
|
+
{% else %}
|
|
35
|
+
{% include "404/_404.njk" %}
|
|
36
|
+
{{ content | safe }}
|
|
37
|
+
{% endif %}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Add a new `{% elif %}` block for each page, listing its components in order. If a component lives in a subfolder, specify the relative path accordingly
|
|
41
|
+
|
|
42
|
+
> ⚠️ A new `elif` block is automatically added when you create a page via the Assistant CLI
|
|
43
|
+
|
|
44
|
+
> ⚠️ If you move or delete a component, always update `page-components.njk` or the site will break
|
|
45
|
+
|
|
46
|
+
## Nest components
|
|
47
|
+
|
|
48
|
+
A component can include other components. This is useful for breaking complex sections into smaller, reusable pieces.
|
|
49
|
+
|
|
50
|
+
### exampleComponent.njk
|
|
51
|
+
```js
|
|
52
|
+
<section class="hero">
|
|
53
|
+
{% include "ui/heroTitle.njk" %}
|
|
54
|
+
{% include "ui/heroButton.njk" %}
|
|
55
|
+
</section>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
> The same path rules apply: if the included component is in a subfolder, specify the full relative path.
|
|
59
|
+
|
|
60
|
+
## Global components
|
|
61
|
+
|
|
62
|
+
Header and footer live in `src/frontend/components/global/` and are automatically included in every page via `base.njk`. Edit them to change the site-wide layout
|
|
63
|
+
|
|
64
|
+
## Site data in components
|
|
65
|
+
|
|
66
|
+
All values defined in `src/frontend/data/site.json` are globally available in every component via `{{ site.* }}`
|
|
67
|
+
|
|
68
|
+
### site.json <small>(`src/frontend/data/`)</small>
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"title": "My Site",
|
|
72
|
+
"theme": "dark",
|
|
73
|
+
"logo": "/assets/brand/logo.svg",
|
|
74
|
+
"legal": {
|
|
75
|
+
"privacy": "/privacy"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Usage in any `.njk` file
|
|
81
|
+
```js
|
|
82
|
+
<p>{{ site.title }}</p>
|
|
83
|
+
<a href="{{ site.legal.privacy }}">Privacy Policy</a>
|
|
84
|
+
<img src="{{ site.logo }}" alt="{{ site.title }}">
|
|
85
85
|
```
|
package/docs/Creating pages.md
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
# Creating Pages
|
|
2
|
-
|
|
3
|
-
> Examples use JavaScript, but everything applies equally to TypeScript. The only difference is the file extension (`.ts` instead of `.js`), that imports do **not** include the extension, and that paths use `src/frontend/ts/` instead of `src/frontend/js/`.
|
|
4
|
-
|
|
5
|
-
The recommended way is via the **Assistant CLI**
|
|
6
|
-
|
|
7
|
-
## What gets created
|
|
8
|
-
For a page named `my-page`:
|
|
9
|
-
|
|
10
|
-
| File | Purpose |
|
|
11
|
-
|---|---|
|
|
12
|
-
| `src/frontend/routes/my-page.njk` | Template with front matter |
|
|
13
|
-
| `src/frontend/scss/pages/myPage.scss` | Imports framework + modules |
|
|
14
|
-
| `src/frontend/js/pages/myPage.js` | Imports JS modules |
|
|
15
|
-
|
|
16
|
-
## Adding content
|
|
17
|
-
|
|
18
|
-
1. Create a component in `src/frontend/components/` (e.g. `_myPage.njk`)
|
|
19
|
-
2. Include it in `src/frontend/layouts/page-components.njk` inside the generated `elif` block:
|
|
20
|
-
|
|
21
|
-
```njk
|
|
22
|
-
{% elif title == "myPage" %}
|
|
23
|
-
{% include "_myPage.njk" %}
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
See **Components** DOC file for more info
|
|
27
|
-
|
|
28
|
-
## URL and title
|
|
29
|
-
|
|
30
|
-
The URL is the kebab-case name (`/my-page/`). The `title` in the front matter is camelCase (`myPage`) and is used internally to load the correct CSS and JS files — do not change it.
|
|
31
|
-
|
|
32
|
-
## Subpages (nested URLs)
|
|
33
|
-
|
|
34
|
-
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:
|
|
35
|
-
|
|
36
|
-
```njk
|
|
37
|
-
---
|
|
38
|
-
title: "team"
|
|
39
|
-
permalink: "about/team/"
|
|
40
|
-
layout: page-components.njk
|
|
41
|
-
---
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
The parent path (`about`) does **not** need to exist as a real page — it's just a URL prefix. Only the last segment (`team`) must match the filename and the `title` in the front matter.
|
|
45
|
-
|
|
46
|
-
| Goal URL | permalink value | File |
|
|
47
|
-
|---|---|---|
|
|
48
|
-
| `/team/` | `/team/` | `routes/team.njk` |
|
|
49
|
-
| `/about/team/` | `/about/team/` | `routes/team.njk` |
|
|
50
|
-
| `/company/about/team/` | `/company/about/team/` | `routes/team.njk` |
|
|
51
|
-
|
|
52
|
-
## SEO
|
|
53
|
-
|
|
54
|
-
The CLI creates a stub entry in `src/frontend/data/site.json`. Fill it in:
|
|
55
|
-
|
|
56
|
-
```json
|
|
57
|
-
"myPage": {
|
|
58
|
-
"seo": {
|
|
59
|
-
"title": "My Page | Site Name",
|
|
60
|
-
"description": "Page description"
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
1
|
+
# Creating Pages
|
|
2
|
+
|
|
3
|
+
> Examples use JavaScript, but everything applies equally to TypeScript. The only difference is the file extension (`.ts` instead of `.js`), that imports do **not** include the extension, and that paths use `src/frontend/ts/` instead of `src/frontend/js/`.
|
|
4
|
+
|
|
5
|
+
The recommended way is via the **Assistant CLI**
|
|
6
|
+
|
|
7
|
+
## What gets created
|
|
8
|
+
For a page named `my-page`:
|
|
9
|
+
|
|
10
|
+
| File | Purpose |
|
|
11
|
+
|---|---|
|
|
12
|
+
| `src/frontend/routes/my-page.njk` | Template with front matter |
|
|
13
|
+
| `src/frontend/scss/pages/myPage.scss` | Imports framework + modules |
|
|
14
|
+
| `src/frontend/js/pages/myPage.js` | Imports JS modules |
|
|
15
|
+
|
|
16
|
+
## Adding content
|
|
17
|
+
|
|
18
|
+
1. Create a component in `src/frontend/components/` (e.g. `_myPage.njk`)
|
|
19
|
+
2. Include it in `src/frontend/layouts/page-components.njk` inside the generated `elif` block:
|
|
20
|
+
|
|
21
|
+
```njk
|
|
22
|
+
{% elif title == "myPage" %}
|
|
23
|
+
{% include "_myPage.njk" %}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
See **Components** DOC file for more info
|
|
27
|
+
|
|
28
|
+
## URL and title
|
|
29
|
+
|
|
30
|
+
The URL is the kebab-case name (`/my-page/`). The `title` in the front matter is camelCase (`myPage`) and is used internally to load the correct CSS and JS files — do not change it.
|
|
31
|
+
|
|
32
|
+
## Subpages (nested URLs)
|
|
33
|
+
|
|
34
|
+
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:
|
|
35
|
+
|
|
36
|
+
```njk
|
|
37
|
+
---
|
|
38
|
+
title: "team"
|
|
39
|
+
permalink: "about/team/"
|
|
40
|
+
layout: page-components.njk
|
|
41
|
+
---
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The parent path (`about`) does **not** need to exist as a real page — it's just a URL prefix. Only the last segment (`team`) must match the filename and the `title` in the front matter.
|
|
45
|
+
|
|
46
|
+
| Goal URL | permalink value | File |
|
|
47
|
+
|---|---|---|
|
|
48
|
+
| `/team/` | `/team/` | `routes/team.njk` |
|
|
49
|
+
| `/about/team/` | `/about/team/` | `routes/team.njk` |
|
|
50
|
+
| `/company/about/team/` | `/company/about/team/` | `routes/team.njk` |
|
|
51
|
+
|
|
52
|
+
## SEO
|
|
53
|
+
|
|
54
|
+
The CLI creates a stub entry in `src/frontend/data/site.json`. Fill it in:
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
"myPage": {
|
|
58
|
+
"seo": {
|
|
59
|
+
"title": "My Page | Site Name",
|
|
60
|
+
"description": "Page description"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
65
|
See **Head & SEO** for all available options.
|