create-berna-stencil 1.0.27 → 1.0.28

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.
@@ -15,7 +15,7 @@ function addLayout(pageName) {
15
15
 
16
16
  if (content.includes(`{% elif title == "${camelName}" %}`)) return;
17
17
 
18
- const newElif = `{% elif title == "${camelName}" %}\n {#{% include "exampleComponent.njk" %}#}\n\n`;
18
+ const newElif = `{% elif title == "${camelName}" %}\n {#{% include "component.njk" %}#}\n\n`;
19
19
  const updatedContent = content.replace('{% else %}', `${newElif}{% else %}`);
20
20
 
21
21
  fileSystem.writeFileSync(INCLUDES_PATH, updatedContent);
@@ -20,4 +20,4 @@ document.addEventListener("DOMContentLoaded", () => {
20
20
  initLangSwitcher();
21
21
  });
22
22
 
23
- showNotification("prova notification", "success", 3000);
23
+ showNotification("Example notification", "success", 3000);
package/bin/create.js CHANGED
@@ -17,7 +17,7 @@ const COPY_TARGETS = [
17
17
 
18
18
  const PROJECT_PACKAGE = {
19
19
  name: path.basename(targetDir),
20
- version: '1.0.27',
20
+ version: '1.0.28',
21
21
  private: true,
22
22
  scripts: {
23
23
  "build:css": "sass src/scss:c:/laragon/www/Berna-Stencil-out/css --no-source-map --style=compressed --quiet",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-berna-stencil",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "Eleventy boilerplate with per-page SCSS/JS pipeline, esbuild bundling, multi-framework CSS support and a built-in page management CLI",
5
5
  "keywords": [
6
6
  "eleventy",
@@ -1,32 +1,26 @@
1
1
  <footer>
2
- <div class="row">
3
- <div class="col-lg-4">
4
- <h6 class="mb-3">{{ site.title }}</h6>
2
+ <div class="footer-top">
3
+ <div>
4
+ <h6>{{ site.title }}</h6>
5
5
  <p>{{ site.description }}</p>
6
6
  </div>
7
+
8
+ <div>
9
+ <h6>Sitemap</h6>
10
+ <ul>
11
+ <li><a href="/">Homepage</a></li>
12
+ </ul>
13
+ </div>
7
14
  </div>
8
15
 
9
- <hr class="my-3" />
16
+ <hr />
10
17
 
11
- <div class="row">
12
- <div class="col-md-6">
13
- <p>
14
- &copy; {{ site.copyright.year }} {{ site.name }}
15
- {{ site.copyright.text }}.
16
- </p>
17
- </div>
18
- <div class="col-md-6 text-md-end">
19
- <small class="text-muted">
20
- <a href="{{ site.legal.privacy }}" class="text-decoration-none me-3"
21
- >Privacy Policy</a
22
- >
23
- <a href="{{ site.legal.cookie }}" class="text-decoration-none me-3"
24
- >Cookie Policy</a
25
- >
26
- <a href="{{ site.legal.terms }}" class="text-decoration-none me-3"
27
- >Terms and conditions</a
28
- >
29
- </small>
30
- </div>
18
+ <div class="footer-bottom">
19
+ <p>&copy; {{ site.copyright.year }} {{ site.name }} {{ site.copyright.text }}.</p>
20
+ <small>
21
+ <a href="{{ site.legal.privacy }}">Privacy Policy</a>
22
+ <a href="{{ site.legal.cookie }}">Cookie Policy</a>
23
+ <a href="{{ site.legal.terms }}">Terms and conditions</a>
24
+ </small>
31
25
  </div>
32
- </footer>
26
+ </footer>
@@ -4,12 +4,16 @@
4
4
  <img src="{{ site.logo }}" alt="{{ site.title }}" height="40">
5
5
  </a>
6
6
  <div class="nav-links">
7
- <a class="btn btn-primary" href="/">Homepage</a>
8
- <a class="btn btn-primary" href="/another-page">Another page</a>
7
+ <a class="btn btn-outline-primary" href="/">Homepage</a>
8
+ <a class="btn btn-outline-primary" href="/about-us">About-us</a>
9
+ <a class="btn btn-outline-primary" href="/contact-us">Contact us</a>
9
10
  </div>
10
11
  <div class="nav-links">
11
- <a class="btn btn-primary" href="/">ExtraBtn1</a>
12
- <a class="btn btn-primary" href="/">ExtraBtn2</a>
12
+ <select id="lang-select" class="form-select">
13
+ {# enLangName or itLangName is the key that contains the language name accordint to the current language #}
14
+ <option value="en" data-lang-key="enLangName"></option>
15
+ <option value="it" data-lang-key="itLangName"></option>
16
+ </select>
13
17
  </div>
14
18
  </nav>
15
19
  </header>
@@ -85,7 +85,6 @@
85
85
  <!-- Main -->
86
86
  <main>
87
87
  {{ content | safe }}
88
- <br>
89
88
  </main>
90
89
 
91
90
  <!-- Footer -->
@@ -5,7 +5,7 @@ layout: base.njk
5
5
  <!-- NJK (HTML) components per page -->
6
6
 
7
7
  {% if title == "homepage" %}
8
- {% include "exampleComponent.njk" %}
8
+ {% include "welcome.njk" %}
9
9
 
10
10
  {% else %}
11
11
  {% include "404/_404.njk" %}
@@ -0,0 +1,208 @@
1
+ <div class="container fade-in get-started my-5">
2
+
3
+ <span class="gs-badge">open source</span>
4
+ <h1 class="gs-title">Berna Stencil</h1>
5
+ <p class="gs-sub">An Eleventy-based static site starter with SCSS, JS pages, and a built-in CLI scaffolder.</p>
6
+
7
+ <div class="gs-block">
8
+ <p class="gs-block-label">scaffold pages, rename, remove</p>
9
+ <div class="gs-cmd">
10
+ <code>
11
+ <span class="prompt">$ </span>
12
+ <span class="cmd">npm run</span>
13
+ <span class="arg">assistant</span>
14
+ </code>
15
+ <button class="gs-copy" onclick="navigator.clipboard.writeText('npm run assistant'); this.textContent='copied'; setTimeout(()=>this.textContent='copy',1500)">copy</button>
16
+ </div>
17
+
18
+ <hr />
19
+
20
+ <div class="gs-guide-links">
21
+ <a href="https://bernastencil.com/docs/pages"><i class="bi bi-file-plus"></i> adding pages</a>
22
+ <a href="https://bernastencil.com/docs/layouts"><i class="bi bi-layout"></i> layouts</a>
23
+ <a href="https://bernastencil.com/docs/extra-cdn"><i class="bi bi-brand-npm"></i> cdn per page</a>
24
+ <a href="https://bernastencil.com/docs/i18n"><i class="bi bi-world"></i> i18n</a>
25
+ <a href="https://bernastencil.com/docs/scss"><i class="bi bi-palette"></i> scss structure</a>
26
+ </div>
27
+ </div>
28
+
29
+ <hr class="gs-divider" />
30
+
31
+ <ul class="gs-features">
32
+ <li><i class="bi bi-bolt"></i>Eleventy + Nunjucks templating</li>
33
+ <li><i class="bi bi-palette"></i>SCSS with per-page stylesheets</li>
34
+ <li><i class="bi bi-terminal-2"></i>CLI scaffolder for pages</li>
35
+ <li><i class="bi bi-world"></i>Built-in i18n switcher</li>
36
+ <li><i class="bi bi-layout"></i>Component-based layouts</li>
37
+ <li><i class="bi bi-brand-npm"></i>CDN per-page asset management</li>
38
+ </ul>
39
+
40
+ <div class="gs-links">
41
+ <a href="https://github.com/rhaastrake/berna-stencil"><i class="bi bi-github"></i> GitHub</a>
42
+ <a href="https://github.com/rhaastrake/berna-stencil#readme"><i class="bi bi-book"></i> Docs</a>
43
+ <a href="https://github.com/rhaastrake/berna-stencil/issues"><i class="bi bi-bug"></i> Issues</a>
44
+ </div>
45
+
46
+ </div>
47
+
48
+ <style>
49
+ .get-started {
50
+ background: #0d0d0d;
51
+ border: 0.5px solid #2a2a2a;
52
+ border-radius: 16px;
53
+ padding: 2.5rem;
54
+ color: #e2e2e2;
55
+ max-width: 680px;
56
+
57
+ .gs-badge {
58
+ display: inline-block;
59
+ font-size: 11px;
60
+ letter-spacing: 0.08em;
61
+ text-transform: uppercase;
62
+ color: #888;
63
+ border: 0.5px solid #333;
64
+ border-radius: 20px;
65
+ padding: 3px 10px;
66
+ margin-bottom: 1.25rem;
67
+ }
68
+
69
+ .gs-title {
70
+ font-size: 22px;
71
+ font-weight: 500;
72
+ color: #f5f5f5;
73
+ margin: 0 0 0.4rem;
74
+ }
75
+
76
+ .gs-sub {
77
+ font-size: 14px;
78
+ color: #666;
79
+ margin: 0 0 2rem;
80
+ }
81
+
82
+ .gs-block {
83
+ background: #161616;
84
+ border: 0.5px solid #2a2a2a;
85
+ border-radius: 10px;
86
+ padding: 1rem 1.25rem;
87
+ margin-bottom: 1.5rem;
88
+
89
+ hr {
90
+ border: none;
91
+ border-top: 0.5px solid #2a2a2a;
92
+ margin: 1rem 0;
93
+ }
94
+ }
95
+
96
+ .gs-block-label {
97
+ font-size: 11px;
98
+ color: #555;
99
+ letter-spacing: 0.06em;
100
+ text-transform: uppercase;
101
+ margin-bottom: 0.5rem;
102
+ }
103
+
104
+ .gs-cmd {
105
+ display: flex;
106
+ align-items: center;
107
+ justify-content: space-between;
108
+ gap: 1rem;
109
+
110
+ code {
111
+ font-size: 13px;
112
+ color: #c9c9c9;
113
+
114
+ .prompt { color: #444; }
115
+ .cmd { color: #a3e4bc; }
116
+ .arg { color: #7ec8e3; }
117
+ }
118
+ }
119
+
120
+ .gs-copy {
121
+ background: none;
122
+ border: 0.5px solid #333;
123
+ border-radius: 6px;
124
+ padding: 4px 10px;
125
+ color: #666;
126
+ font-size: 11px;
127
+ cursor: pointer;
128
+ white-space: nowrap;
129
+ flex-shrink: 0;
130
+ transition: color 0.15s, border-color 0.15s;
131
+
132
+ &:hover {
133
+ color: #ccc;
134
+ border-color: #555;
135
+ }
136
+ }
137
+
138
+ .gs-guide-links {
139
+ display: flex;
140
+ flex-wrap: wrap;
141
+ gap: 0.5rem 1.5rem;
142
+
143
+ a {
144
+ display: flex;
145
+ align-items: center;
146
+ gap: 5px;
147
+ font-size: 12px;
148
+ color: #555;
149
+ text-decoration: none;
150
+ transition: color 0.15s;
151
+
152
+ i { font-size: 13px; }
153
+
154
+ &:hover { color: #999; }
155
+ }
156
+ }
157
+
158
+ .gs-divider {
159
+ border: none;
160
+ border-top: 0.5px solid #1e1e1e;
161
+ margin: 1.5rem 0;
162
+ }
163
+
164
+ .gs-features {
165
+ list-style: none;
166
+ padding: 0;
167
+ margin: 0 0 1.5rem;
168
+ display: grid;
169
+ grid-template-columns: 1fr 1fr;
170
+ gap: 0.75rem;
171
+
172
+ li {
173
+ display: flex;
174
+ align-items: flex-start;
175
+ gap: 10px;
176
+ font-size: 13px;
177
+ color: #666;
178
+
179
+ i {
180
+ font-size: 15px;
181
+ color: #444;
182
+ margin-top: 1px;
183
+ flex-shrink: 0;
184
+ }
185
+ }
186
+ }
187
+
188
+ .gs-links {
189
+ display: flex;
190
+ gap: 1.5rem;
191
+ flex-wrap: wrap;
192
+
193
+ a {
194
+ display: flex;
195
+ align-items: center;
196
+ gap: 6px;
197
+ font-size: 13px;
198
+ color: #555;
199
+ text-decoration: none;
200
+ transition: color 0.15s;
201
+
202
+ i { font-size: 15px; }
203
+
204
+ &:hover { color: #aaa; }
205
+ }
206
+ }
207
+ }
208
+ </style>
@@ -10,9 +10,8 @@
10
10
  },
11
11
 
12
12
  "error404Message": "Oops! Page not found",
13
- "error404Return": "Return to homepage",
13
+ "error404Return": "Return to homepage"
14
14
 
15
- "test": "This is the english translation for the test key"
16
15
  },
17
16
  "it": {
18
17
  "enLangName": "Inglese",
@@ -25,8 +24,7 @@
25
24
  },
26
25
 
27
26
  "error404Message": "Oops! Pagina non trovata",
28
- "error404Return": "Ritorna alla homepage",
29
-
30
- "test": "Questa è la traduzione italiana per la chiave test"
27
+ "error404Return": "Ritorna alla homepage"
28
+
31
29
  }
32
30
  }
@@ -20,14 +20,21 @@ export async function initLangSwitcher() {
20
20
 
21
21
  applyLanguage(initialLang, data);
22
22
 
23
- document.querySelectorAll("input[name='lang-button']").forEach((radio) => {
23
+ function handleLangChange(value) {
24
+ localStorage.setItem("language", value);
25
+ applyLanguage(value, data);
26
+ }
27
+
28
+ // Radio buttons
29
+ document.querySelectorAll("input[type='radio'][name='lang-button']").forEach((radio) => {
24
30
  if (radio.value === initialLang) radio.checked = true;
31
+ radio.addEventListener("change", () => handleLangChange(radio.value));
32
+ });
25
33
 
26
- radio.addEventListener("change", () => {
27
- const newLang = radio.value;
28
- localStorage.setItem("language", newLang);
29
- applyLanguage(newLang, data);
30
- });
34
+ // Select
35
+ document.querySelectorAll("select#lang-select").forEach((select) => {
36
+ select.value = initialLang;
37
+ select.addEventListener("change", () => handleLangChange(select.value));
31
38
  });
32
39
  }
33
40
 
@@ -14,7 +14,7 @@ import { showNotification } from '../modules/notification.js';
14
14
  // import { initNormalizePhoneNumber } from '../modules/forms/normalizePhoneNumber.js';
15
15
 
16
16
  //==========================
17
- // "homepage" PAGE CUSTOM JAVASCRIPT
17
+ // PAGE CUSTOM JAVASCRIPT
18
18
  //==========================
19
19
 
20
20
  document.addEventListener("DOMContentLoaded", () => {
@@ -22,4 +22,4 @@ document.addEventListener("DOMContentLoaded", () => {
22
22
  initFormListener();
23
23
  });
24
24
 
25
- showNotification("homepage notification", "success", 3000);
25
+ showNotification("Example notification", "success", 3000);
@@ -0,0 +1,19 @@
1
+ .btn {
2
+ background: none;
3
+ border: 0.5px solid #333;
4
+ border-radius: 8px;
5
+ padding: 8px 18px;
6
+ color: #aaa;
7
+ font-size: 13px;
8
+ cursor: pointer;
9
+ transition: color 0.15s, border-color 0.15s;
10
+
11
+ &:hover {
12
+ color: #eee;
13
+ border-color: #666;
14
+ }
15
+
16
+ &:active {
17
+ transform: scale(0.97);
18
+ }
19
+ }
@@ -2,11 +2,44 @@
2
2
  // CSS RULES FOR FOOTER
3
3
  //==========================
4
4
 
5
- // Getting root rules from _root.scss
6
5
  @use 'root' as root;
7
6
 
8
7
  footer {
9
8
  width: 100%;
10
9
  padding: root.$header-padding-y root.$header-padding-x;
11
10
  background-color: root.$primary;
11
+
12
+ h6 {
13
+ margin-bottom: 0.75rem;
14
+ }
15
+
16
+ ul {
17
+ list-style: none;
18
+ padding: 0;
19
+ margin: 0;
20
+ }
21
+
22
+ a {
23
+ text-decoration: none;
24
+ }
25
+
26
+ hr {
27
+ margin: 1rem 0;
28
+ }
29
+
30
+ .footer-top {
31
+ display: flex;
32
+ justify-content: space-evenly;
33
+ }
34
+
35
+ .footer-bottom {
36
+ display: flex;
37
+ justify-content: space-between;
38
+ align-items: center;
39
+
40
+ small {
41
+ display: flex;
42
+ gap: 1rem;
43
+ }
44
+ }
12
45
  }
@@ -5,14 +5,6 @@
5
5
  // Getting root rules from _root.scss
6
6
  @use 'root' as root;
7
7
 
8
- // ╔═════════════════════════════════════════════════════════════╗
9
- // ║ CSS FRAMEWORK ║
10
- // ║ Uncomment the framework you want to use (only one at time) ║
11
- // ║ To reduce or filter modules, edit the corresponding file: ║
12
- // ║ _bootstrap.scss / _bulma.scss ║
13
- // ║ _uikit.scss / _foundation.scss ║
14
- // ╚═════════════════════════════════════════════════════════════╝
15
-
16
8
  @import "../modules/frameworks/bootstrap";
17
9
  // @import "../modules/frameworks/bulma";
18
10
  // @import "../modules/frameworks/foundation";
@@ -27,6 +19,8 @@
27
19
  @import "animations";
28
20
  @import "mobile";
29
21
 
22
+ // @import "buttons";
23
+
30
24
  *,
31
25
  *::before,
32
26
  *::after {
@@ -35,6 +29,12 @@
35
29
  box-sizing: border-box;
36
30
  }
37
31
 
38
- button {
39
- cursor: pointer;
32
+ body {
33
+ min-height: 100vh;
34
+ display: flex;
35
+ flex-direction: column;
36
+ }
37
+
38
+ main {
39
+ flex: 1;
40
40
  }
@@ -28,5 +28,5 @@ nav a {
28
28
 
29
29
  .nav-links{
30
30
  display: flex;
31
- gap: 15px;
31
+ gap: 120px;
32
32
  }
@@ -1,15 +0,0 @@
1
- <div class="container fade-in">
2
- <h1>This is components/exampleComponent.njk content</h1>
3
- <h2 data-lang-key="test"></h2>
4
-
5
- <div class="btn-group" role="group">
6
-
7
- {# enLangName is the key that contains the language name accordint to the current language #}
8
- <input type="radio" class="btn-check" name="lang-button" id="lang-en" value="en"/>
9
- <label class="btn btn-outline-primary" for="lang-en" data-lang-key="enLangName"></label>
10
-
11
- {# itLangName is the key that contains the language name accordint to the current language #}
12
- <input type="radio" class="btn-check" name="lang-button" id="lang-it" value="it"/>
13
- <label class="btn btn-outline-primary" for="lang-it" data-lang-key="itLangName"></label>
14
- </div>
15
- </div>