create-berna-stencil 1.0.53 → 1.0.54
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 +1 -0
- package/README.md +32 -3
- package/package.json +1 -1
- package/src/frontend/components/welcome.njk +575 -28
package/.eleventy.js
CHANGED
|
@@ -10,6 +10,7 @@ module.exports = function (eleventyConfig) {
|
|
|
10
10
|
|
|
11
11
|
function copyRecursiveSync(src, dest) {
|
|
12
12
|
if (!fs.existsSync(src)) return;
|
|
13
|
+
if (src.includes('.git')) return;
|
|
13
14
|
const stat = fs.statSync(src);
|
|
14
15
|
if (stat.isDirectory()) {
|
|
15
16
|
fs.mkdirSync(dest, { recursive: true });
|
package/README.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# 🏗️ Berna-Stencil
|
|
2
|
-
|
|
2
|
+
**Berna-Stencil** is an open source static site generator built on top of [Eleventy](https://www.11ty.dev/), designed with one clear mission: make web development simple, approachable, and enjoyable — for everyone.
|
|
3
|
+
|
|
4
|
+
Whether you're a seasoned developer looking for a clean starting point or a beginner taking your first steps into the world of web creation, Berna-Stencil gives you everything you need, right out of the box. No complicated setup, no hours spent reading documentation, no frustration — just a solid, well-structured foundation ready to become your next website.
|
|
5
|
+
|
|
6
|
+
### ✨ Why Berna-Stencil?
|
|
7
|
+
|
|
8
|
+
Building a website from scratch involves a lot of moving parts: templating engines, build pipelines, asset management, backend logic, project structure. Berna-Stencil takes care of all of that for you, so you can focus on what actually matters — **your content and your ideas**.
|
|
9
|
+
|
|
10
|
+
- 🔧 **Zero-config ready** — clone, install, and you're live in minutes
|
|
11
|
+
- 🔗 **Integrated backend** — essential server-side functionality included, no extra setup required
|
|
12
|
+
- 📁 **Scalable structure** — a clean, opinionated project layout that grows with your needs
|
|
13
|
+
- 🌍 **Open source** — free to use, free to modify, free to share
|
|
3
14
|
|
|
4
15
|

|
|
5
16
|

|
|
@@ -7,15 +18,20 @@ A professional boilerplate for Eleventy, lightweight and structure-focused, read
|
|
|
7
18
|
|
|
8
19
|
## Prerequisites
|
|
9
20
|
* **Node.js**: v18.0.0 or higher
|
|
21
|
+
* **Composer**: latest stable version
|
|
10
22
|
|
|
11
23
|
## Installation
|
|
12
24
|
* Open your IDE (e.g. Visual Studio Code), open the folder that contains your websites and open a new terminal
|
|
13
25
|
* Run the command for your system to download the project and install everything:
|
|
14
|
-
#### Windows
|
|
15
26
|
```bash
|
|
16
27
|
npm create berna-stencil@latest your-project
|
|
17
28
|
```
|
|
18
29
|
|
|
30
|
+
* Navigate into the project folder
|
|
31
|
+
```bash
|
|
32
|
+
cd your-project
|
|
33
|
+
```
|
|
34
|
+
|
|
19
35
|
* Install all the node_modules
|
|
20
36
|
```bash
|
|
21
37
|
npm install
|
|
@@ -24,4 +40,17 @@ A professional boilerplate for Eleventy, lightweight and structure-focused, read
|
|
|
24
40
|
* Run the command to launch the live server and build the site, then visit localhost:8080:
|
|
25
41
|
```bash
|
|
26
42
|
npm run serve
|
|
27
|
-
```
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Changelog
|
|
46
|
+
|
|
47
|
+
### [1.0.0] - 2025-05-27
|
|
48
|
+
* Initial release
|
|
49
|
+
* Eleventy v3.1.2 support
|
|
50
|
+
* Base project structure and scaffolding CLI
|
|
51
|
+
|
|
52
|
+
## Roadmap
|
|
53
|
+
* [ ] Add support for multiple themes
|
|
54
|
+
* [ ] Improve CLI with interactive prompts
|
|
55
|
+
* [ ] Add TypeScript support
|
|
56
|
+
* [ ] Extend documentation with advanced usage examples
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-berna-stencil",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.54",
|
|
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
|
"author": "Michele Garofalo",
|
|
@@ -1,35 +1,426 @@
|
|
|
1
1
|
<div class="container my-3">
|
|
2
2
|
<h1>Welcome to <span class="berna-stencil">Berna-Stencil</span></h1>
|
|
3
|
-
<div class="slogan">The
|
|
4
|
-
|
|
5
|
-
<div class="
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
class="
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
</
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
>
|
|
26
|
-
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
3
|
+
<div class="slogan">The boilerplate you need, simplified</div>
|
|
4
|
+
|
|
5
|
+
<div class="guide-filter">
|
|
6
|
+
<label>
|
|
7
|
+
<input type="radio" name="guide-filter" value="welcome" checked />
|
|
8
|
+
<span class="filter-pill">Welcome</span>
|
|
9
|
+
</label>
|
|
10
|
+
<label>
|
|
11
|
+
<input type="radio" name="guide-filter" value="assistant" />
|
|
12
|
+
<span class="filter-pill">Assistant</span>
|
|
13
|
+
</label>
|
|
14
|
+
<label>
|
|
15
|
+
<input type="radio" name="guide-filter" value="styling" />
|
|
16
|
+
<span class="filter-pill">Styling</span>
|
|
17
|
+
</label>
|
|
18
|
+
<label>
|
|
19
|
+
<input type="radio" name="guide-filter" value="javascript" />
|
|
20
|
+
<span class="filter-pill">Javascript</span>
|
|
21
|
+
</label>
|
|
22
|
+
<label>
|
|
23
|
+
<input type="radio" name="guide-filter" value="creating-pages" />
|
|
24
|
+
<span class="filter-pill">Creating Pages</span>
|
|
25
|
+
</label>
|
|
26
|
+
<label>
|
|
27
|
+
<input type="radio" name="guide-filter" value="components" />
|
|
28
|
+
<span class="filter-pill">Components</span>
|
|
29
|
+
</label>
|
|
30
|
+
<label>
|
|
31
|
+
<input type="radio" name="guide-filter" value="head-seo" />
|
|
32
|
+
<span class="filter-pill">Head & SEO</span>
|
|
33
|
+
</label>
|
|
34
|
+
<label>
|
|
35
|
+
<input type="radio" name="guide-filter" value="backend" />
|
|
36
|
+
<span class="filter-pill">Backend</span>
|
|
37
|
+
</label>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div class="tabs-container">
|
|
41
|
+
<div id="content-welcome" class="tab-content active">
|
|
42
|
+
<div class="grid" style="display: flex; gap: 1rem; flex-wrap: wrap;">
|
|
43
|
+
<a
|
|
44
|
+
href="https://bernastencil.com"
|
|
45
|
+
class="card"
|
|
46
|
+
target="_blank"
|
|
47
|
+
rel="noopener noreferrer"
|
|
48
|
+
style="flex: 1; min-width: 250px;"
|
|
49
|
+
>
|
|
50
|
+
<i class="bi bi-book card-icon" aria-hidden="true"></i>
|
|
51
|
+
<h3>Documentation</h3>
|
|
52
|
+
<p>
|
|
53
|
+
Everything you need to get started, from setup to advanced topics and
|
|
54
|
+
customizations
|
|
55
|
+
</p>
|
|
56
|
+
<span class="card-link"
|
|
57
|
+
>Go to documentation <span class="bi bi-arrow-right"></span
|
|
58
|
+
></span>
|
|
59
|
+
</a>
|
|
60
|
+
|
|
61
|
+
<a
|
|
62
|
+
href="https://github.com/rhaastrake/berna-stencil"
|
|
63
|
+
class="card"
|
|
64
|
+
target="_blank"
|
|
65
|
+
rel="noopener noreferrer"
|
|
66
|
+
style="flex: 1; min-width: 250px;"
|
|
67
|
+
>
|
|
68
|
+
<i class="bi bi-github card-icon" aria-hidden="true"></i>
|
|
69
|
+
<h3>Github repository</h3>
|
|
70
|
+
<p>Community-driven. Contributions, issues and PRs are welcome.</p>
|
|
71
|
+
<span class="card-link"
|
|
72
|
+
>Open the repository <span class="bi bi-arrow-right"></span
|
|
73
|
+
></span>
|
|
74
|
+
</a>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
{# ASSISTANT #}
|
|
78
|
+
<div id="content-assistant" class="tab-content">
|
|
79
|
+
<div class="markdown-body">
|
|
80
|
+
<h2>Assistant CLI</h2>
|
|
81
|
+
<p>An interactive CLI to manage pages without touching files manually.</p>
|
|
82
|
+
|
|
83
|
+
<pre><code>npm run assistant</code></pre>
|
|
84
|
+
|
|
85
|
+
<h3>Menu</h3>
|
|
86
|
+
<pre><code>1. Create page
|
|
87
|
+
2. Remove page
|
|
88
|
+
3. Rename page
|
|
89
|
+
4. Configure output path</code></pre>
|
|
90
|
+
|
|
91
|
+
<p>Use <code>CTRL/CMD + C</code> to exit.</p>
|
|
92
|
+
|
|
93
|
+
<h3>Create page</h3>
|
|
94
|
+
<p>Enter a page name in any format — the CLI converts it to kebab-case automatically.</p>
|
|
95
|
+
<p>For a page named <code>my-page</code>, the following files are created:</p>
|
|
96
|
+
|
|
97
|
+
<table>
|
|
98
|
+
<thead>
|
|
99
|
+
<tr>
|
|
100
|
+
<th>File</th>
|
|
101
|
+
<th>Purpose</th>
|
|
102
|
+
</tr>
|
|
103
|
+
</thead>
|
|
104
|
+
<tbody>
|
|
105
|
+
<tr>
|
|
106
|
+
<td><code>src/frontend/scss/pages/myPage.scss</code></td>
|
|
107
|
+
<td>SCSS entry point</td>
|
|
108
|
+
</tr>
|
|
109
|
+
<tr>
|
|
110
|
+
<td><code>src/frontend/js/pages/myPage.js</code></td>
|
|
111
|
+
<td>JS entry point</td>
|
|
112
|
+
</tr>
|
|
113
|
+
<tr>
|
|
114
|
+
<td><code>src/frontend/_routes/my-page.njk</code></td>
|
|
115
|
+
<td>Nunjucks template</td>
|
|
116
|
+
</tr>
|
|
117
|
+
</tbody>
|
|
118
|
+
</table>
|
|
119
|
+
|
|
120
|
+
<p>It also adds an <code>elif</code> block in <code>includes.njk</code> and a stub entry in <code>site.json</code>:</p>
|
|
121
|
+
|
|
122
|
+
<pre><code>"myPage": {
|
|
123
|
+
"seo": {
|
|
124
|
+
"title": "My Page",
|
|
125
|
+
"description": "description"
|
|
126
|
+
},
|
|
127
|
+
"cdn": {
|
|
128
|
+
"css": [],
|
|
129
|
+
"js": []
|
|
130
|
+
}
|
|
131
|
+
}</code></pre>
|
|
132
|
+
|
|
133
|
+
<h3>Remove page</h3>
|
|
134
|
+
<p>Deletes all source files for the page and cleans up the output directory, <code>includes.njk</code>, and <code>site.json</code>.</p>
|
|
135
|
+
|
|
136
|
+
<h3>Rename page</h3>
|
|
137
|
+
<p>Renames all three source files, updates the <code>elif</code> block in <code>includes.njk</code>, and renames the record in <code>site.json</code> while preserving all existing fields.</p>
|
|
138
|
+
|
|
139
|
+
<h3>Configure output path</h3>
|
|
140
|
+
<p>Updates the output directory across <code>.eleventy.js</code> and all relevant <code>package.json</code> scripts in one shot. The old output folder is deleted automatically.</p>
|
|
141
|
+
|
|
142
|
+
<blockquote>⚠️ <code>homepage</code> and <code>404</code> are protected — they cannot be created, removed, or renamed via the CLI.</blockquote>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
{# STYLING #}
|
|
146
|
+
<div id="content-styling" class="tab-content">
|
|
147
|
+
<div class="markdown-body">
|
|
148
|
+
<h2>Styling with SCSS</h2>
|
|
149
|
+
|
|
150
|
+
<h3>Page CSS</h3>
|
|
151
|
+
<p>Each page has its own SCSS entry point in <code>src/frontend/scss/pages/</code></p>
|
|
152
|
+
<p>It must contain <code>_root.scss</code> + other modules like <code>_global.scss</code> or any other one that you need and its own specific css rules.</p>
|
|
153
|
+
<p><code>_root.scss</code> uses <code>@use</code> to enable namespaced access (<code>root.$var</code>); other modules use <code>@import</code> as they don't expose variables.</p>
|
|
154
|
+
|
|
155
|
+
<h4>examplePage.scss <small>(<code>src/frontend/scss/pages/</code>)</small></h4>
|
|
156
|
+
<pre><code>//==========================
|
|
157
|
+
// CSS MODULES IMPORTS
|
|
158
|
+
//==========================
|
|
159
|
+
|
|
160
|
+
@use "../modules/root" as root;
|
|
161
|
+
|
|
162
|
+
@import "../modules/global";
|
|
163
|
+
|
|
164
|
+
@import "../modules/notification";
|
|
165
|
+
|
|
166
|
+
//==========================
|
|
167
|
+
// PAGE CUSTOM CSS RULES
|
|
168
|
+
//==========================
|
|
169
|
+
|
|
170
|
+
body {
|
|
171
|
+
background-color: root.$primary;
|
|
172
|
+
}</code></pre>
|
|
173
|
+
|
|
174
|
+
<h3>Global Variables</h3>
|
|
175
|
+
<p>Instead of using <code>:root</code> in your custom modules or pages, the best thing to do is to centralize all your variables in a single file (that will be tree-shaken automatically by Sass).</p>
|
|
176
|
+
|
|
177
|
+
<h4>_root.scss <small>(<code>src/frontend/scss/modules/</code>)</small></h4>
|
|
178
|
+
<pre><code>$header-height: 10vh;
|
|
179
|
+
|
|
180
|
+
// Usage example (in any other file):
|
|
181
|
+
header {
|
|
182
|
+
height: root.$header-height;
|
|
183
|
+
}</code></pre>
|
|
184
|
+
|
|
185
|
+
<h3>Scss modules</h3>
|
|
186
|
+
<p>You can create your custom css modules by creating a new <code>.scss</code> file in <code>src/frontend/scss/modules/</code> (the name of the file must start with <code>_</code>).</p>
|
|
187
|
+
<p>You can create subfolders if you want to refactor the structure, but be sure to update the relative paths in the pages that import them.</p>
|
|
188
|
+
|
|
189
|
+
<h4>_yourModule.scss <small>(<code>src/frontend/scss/modules/subfolder/</code>)</small></h4>
|
|
190
|
+
<pre><code>@use '../root' as root;
|
|
191
|
+
|
|
192
|
+
body {
|
|
193
|
+
background-color: root.$primary;
|
|
194
|
+
}</code></pre>
|
|
195
|
+
|
|
196
|
+
<h4>examplePage.scss</h4>
|
|
197
|
+
<pre><code>@import "../modules/subfolder/yourModule";
|
|
198
|
+
|
|
199
|
+
// This page will now inherit the body tag rules
|
|
200
|
+
// If the same property is declared in both, the last imported one wins
|
|
201
|
+
body {
|
|
202
|
+
color: root.$dark;
|
|
203
|
+
}</code></pre>
|
|
204
|
+
|
|
205
|
+
<h4>Pre-existing modules</h4>
|
|
206
|
+
<table>
|
|
207
|
+
<thead>
|
|
208
|
+
<tr>
|
|
209
|
+
<th>File</th>
|
|
210
|
+
<th>Purpose</th>
|
|
211
|
+
</tr>
|
|
212
|
+
</thead>
|
|
213
|
+
<tbody>
|
|
214
|
+
<tr>
|
|
215
|
+
<td><code>_root.scss</code></td>
|
|
216
|
+
<td>Global variables (colors, spacing)</td>
|
|
217
|
+
</tr>
|
|
218
|
+
<tr>
|
|
219
|
+
<td><code>_global.scss</code></td>
|
|
220
|
+
<td>Site-wide base rules and frameworks</td>
|
|
221
|
+
</tr>
|
|
222
|
+
<tr>
|
|
223
|
+
<td><code>_typography.scss</code></td>
|
|
224
|
+
<td>Font rules</td>
|
|
225
|
+
</tr>
|
|
226
|
+
<tr>
|
|
227
|
+
<td><code>_header.scss</code></td>
|
|
228
|
+
<td>Header styles</td>
|
|
229
|
+
</tr>
|
|
230
|
+
<tr>
|
|
231
|
+
<td><code>_footer.scss</code></td>
|
|
232
|
+
<td>Footer styles</td>
|
|
233
|
+
</tr>
|
|
234
|
+
<tr>
|
|
235
|
+
<td><code>_mobile.scss</code></td>
|
|
236
|
+
<td>Media query rules</td>
|
|
237
|
+
</tr>
|
|
238
|
+
<tr>
|
|
239
|
+
<td><code>_buttons.scss</code></td>
|
|
240
|
+
<td>Style and hovers for buttons</td>
|
|
241
|
+
</tr>
|
|
242
|
+
<tr>
|
|
243
|
+
<td><code>_animations.scss</code></td>
|
|
244
|
+
<td>Keyframe animations (<code>fade-in</code>, <code>spin</code>)</td>
|
|
245
|
+
</tr>
|
|
246
|
+
<tr>
|
|
247
|
+
<td><code>_notification.scss</code></td>
|
|
248
|
+
<td>Notification component style</td>
|
|
249
|
+
</tr>
|
|
250
|
+
</tbody>
|
|
251
|
+
</table>
|
|
252
|
+
|
|
253
|
+
<h3>CSS Framework</h3>
|
|
254
|
+
<p>Some of the most popular css frameworks that supports scss with modules are already installed in <code>node_modules</code>.</p>
|
|
255
|
+
<p>You can choose one or none of them (more than 1 works, but you may get in various conflicts).</p>
|
|
256
|
+
<p>To enable/disable them you have to modify 3 files around the project by just commenting them.</p>
|
|
257
|
+
|
|
258
|
+
<h4>1. _global.scss <small>(<code>src/frontend/scss/modules/</code>)</small></h4>
|
|
259
|
+
<pre><code>@import "../modules/frameworks/bootstrap";
|
|
260
|
+
// @import "../modules/frameworks/bulma";
|
|
261
|
+
// @import "../modules/frameworks/foundation";
|
|
262
|
+
// @import "../modules/frameworks/uikit";</code></pre>
|
|
263
|
+
|
|
264
|
+
<h4>2. base.njk <small>(<code>src/frontend/components/layouts/</code>)</small></h4>
|
|
265
|
+
<pre><code>{# Bootstrap JS #}
|
|
266
|
+
<script src="/js/bootstrap.bundle.min.js" defer></script>
|
|
267
|
+
|
|
268
|
+
{# Foundation JS #}
|
|
269
|
+
{# <script src="/js/foundation.min.js" defer></script> #}
|
|
270
|
+
|
|
271
|
+
{# UIkit JS #}
|
|
272
|
+
{# <script src="/js/uikit.min.js" defer></script> #}
|
|
273
|
+
{# <script src="/js/uikit-icons.min.js" defer></script> #}
|
|
274
|
+
|
|
275
|
+
{# Bulma — no JS needed #}</code></pre>
|
|
276
|
+
|
|
277
|
+
<h4>3. .eleventy.js</h4>
|
|
278
|
+
<pre><code>eleventyConfig.addPassthroughCopy({
|
|
279
|
+
// Bootstrap
|
|
280
|
+
"node_modules/bootstrap/dist/js/bootstrap.bundle.min.js": "js/bootstrap.bundle.min.js",
|
|
281
|
+
"node_modules/bootstrap-icons/font/fonts": "css/fonts",
|
|
282
|
+
|
|
283
|
+
// Foundation
|
|
284
|
+
// "node_modules/foundation-sites/dist/js/foundation.min.js": "js/foundation.min.js",
|
|
285
|
+
|
|
286
|
+
// UIkit
|
|
287
|
+
// "node_modules/uikit/dist/js/uikit.min.js": "js/uikit.min.js",
|
|
288
|
+
// "node_modules/uikit/dist/js/uikit-icons.min.js": "js/uikit-icons.min.js",
|
|
289
|
+
|
|
290
|
+
// Bulma — CSS only, no JS passthrough needed
|
|
291
|
+
});</code></pre>
|
|
292
|
+
|
|
293
|
+
<h4>Reducing bundle size</h4>
|
|
294
|
+
<p>To reduce the bundle size, open the corresponding framework file (<code>src/frontend/scss/modules/frameworks/</code>) and comment out any modules you don't need.</p>
|
|
295
|
+
<pre><code>@import "bootstrap/scss/card"; // Cards
|
|
296
|
+
@import "bootstrap/scss/carousel"; // Carousel</code></pre>
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
{# JAVASCRIPT #}
|
|
300
|
+
<div id="content-javascript" class="tab-content">
|
|
301
|
+
<div class="markdown-body">
|
|
302
|
+
<h2>JavaScript</h2>
|
|
303
|
+
|
|
304
|
+
<h3>Page JS</h3>
|
|
305
|
+
<p>Each page has its own JS entry point in <code>src/frontend/js/pages/</code></p>
|
|
306
|
+
<p>It is bundled and minified by esbuild and loaded automatically by <code>base.njk</code></p>
|
|
307
|
+
<p>Import only what the page needs.</p>
|
|
308
|
+
|
|
309
|
+
<h4>examplePage.js <small>(<code>src/frontend/js/pages/</code>)</small></h4>
|
|
310
|
+
<pre><code>import { initLangSwitcher } from '../modules/langSwitcher.js';
|
|
311
|
+
import { showNotification } from '../modules/notification.js';
|
|
312
|
+
|
|
313
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
314
|
+
initLangSwitcher();
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
showNotification("Page loaded", "success", 3000);</code></pre>
|
|
318
|
+
|
|
319
|
+
<h3>Modules</h3>
|
|
320
|
+
<p>Modules live in <code>src/frontend/js/modules/</code>. Some must be called inside <code>DOMContentLoaded</code> as they interact with the DOM; others create elements dynamically and can be called anywhere.</p>
|
|
321
|
+
|
|
322
|
+
<h4>Call inside <code>DOMContentLoaded</code></h4>
|
|
323
|
+
<table>
|
|
324
|
+
<thead>
|
|
325
|
+
<tr>
|
|
326
|
+
<th>Module</th>
|
|
327
|
+
<th>Function</th>
|
|
328
|
+
</tr>
|
|
329
|
+
</thead>
|
|
330
|
+
<tbody>
|
|
331
|
+
<tr>
|
|
332
|
+
<td><code>modules/langSwitcher.js</code></td>
|
|
333
|
+
<td><code>initLangSwitcher()</code></td>
|
|
334
|
+
</tr>
|
|
335
|
+
<tr>
|
|
336
|
+
<td><code>modules/forms/form.js</code></td>
|
|
337
|
+
<td><code>initFormListener()</code></td>
|
|
338
|
+
</tr>
|
|
339
|
+
<tr>
|
|
340
|
+
<td><code>modules/forms/textAreaAutoExpand.js</code></td>
|
|
341
|
+
<td><code>initTextAreaAutoExpand()</code></td>
|
|
342
|
+
</tr>
|
|
343
|
+
<tr>
|
|
344
|
+
<td><code>modules/forms/normalizePhoneNumber.js</code></td>
|
|
345
|
+
<td><code>initNormalizePhoneNumber()</code></td>
|
|
346
|
+
</tr>
|
|
347
|
+
</tbody>
|
|
348
|
+
</table>
|
|
349
|
+
|
|
350
|
+
<h4>Call anywhere</h4>
|
|
351
|
+
<table>
|
|
352
|
+
<thead>
|
|
353
|
+
<tr>
|
|
354
|
+
<th>Module</th>
|
|
355
|
+
<th>Function</th>
|
|
356
|
+
</tr>
|
|
357
|
+
</thead>
|
|
358
|
+
<tbody>
|
|
359
|
+
<tr>
|
|
360
|
+
<td><code>modules/notification.js</code></td>
|
|
361
|
+
<td><code>showNotification(text, type, duration)</code></td>
|
|
362
|
+
</tr>
|
|
363
|
+
</tbody>
|
|
364
|
+
</table>
|
|
365
|
+
|
|
366
|
+
<h4><code>showNotification</code> parameters</h4>
|
|
367
|
+
<table>
|
|
368
|
+
<thead>
|
|
369
|
+
<tr>
|
|
370
|
+
<th>Parameter</th>
|
|
371
|
+
<th>Type</th>
|
|
372
|
+
<th>Default</th>
|
|
373
|
+
<th>Values</th>
|
|
374
|
+
</tr>
|
|
375
|
+
</thead>
|
|
376
|
+
<tbody>
|
|
377
|
+
<tr>
|
|
378
|
+
<td><code>text</code></td>
|
|
379
|
+
<td>string</td>
|
|
380
|
+
<td>—</td>
|
|
381
|
+
<td>Any string</td>
|
|
382
|
+
</tr>
|
|
383
|
+
<tr>
|
|
384
|
+
<td><code>type</code></td>
|
|
385
|
+
<td>string</td>
|
|
386
|
+
<td><code>"info"</code></td>
|
|
387
|
+
<td><code>"success"</code>, <code>"info"</code>, <code>"error"</code></td>
|
|
388
|
+
</tr>
|
|
389
|
+
<tr>
|
|
390
|
+
<td><code>duration</code></td>
|
|
391
|
+
<td>number</td>
|
|
392
|
+
<td><code>5000</code></td>
|
|
393
|
+
<td>ms, or <code>-1</code> for persistent with spinner</td>
|
|
394
|
+
</tr>
|
|
395
|
+
</tbody>
|
|
396
|
+
</table>
|
|
397
|
+
|
|
398
|
+
<h3>Adding a module</h3>
|
|
399
|
+
<p>Create a new <code>.js</code> file in <code>src/frontend/js/modules/</code>. You can organize them into subfolders freely.</p>
|
|
400
|
+
<p>Use ESM syntax — esbuild handles the bundling:</p>
|
|
401
|
+
|
|
402
|
+
<pre><code>// _yourModule.js
|
|
403
|
+
export function yourFunction() {
|
|
404
|
+
// ...
|
|
405
|
+
}</code></pre>
|
|
406
|
+
|
|
407
|
+
<p>Then import it in the pages that need it:</p>
|
|
408
|
+
|
|
409
|
+
<pre><code>import { yourFunction } from '../modules/yourModule.js';</code></pre>
|
|
410
|
+
|
|
411
|
+
<blockquote>⚠️ Files inside <code>_tools/</code> run directly in Node.js without a bundler — use CommonJS (<code>require</code> / <code>module.exports</code>) there, not ESM.</blockquote>
|
|
412
|
+
</div>
|
|
413
|
+
</div>
|
|
414
|
+
|
|
415
|
+
<div id="content-deployment" class="tab-content">
|
|
416
|
+
<div class="markdown-body">
|
|
417
|
+
<h2>Deployment</h2>
|
|
418
|
+
<p>Extra 2</p>
|
|
419
|
+
</div>
|
|
420
|
+
</div>
|
|
31
421
|
</div>
|
|
32
422
|
</div>
|
|
423
|
+
|
|
33
424
|
<style>
|
|
34
425
|
h1 {
|
|
35
426
|
text-align: center;
|
|
@@ -45,6 +436,20 @@
|
|
|
45
436
|
font-size: 1.5rem;
|
|
46
437
|
margin-bottom: 1rem;
|
|
47
438
|
}
|
|
439
|
+
|
|
440
|
+
/* Tabs Logic */
|
|
441
|
+
.tab-content {
|
|
442
|
+
display: none;
|
|
443
|
+
animation: fadeIn 0.3s ease-in-out;
|
|
444
|
+
}
|
|
445
|
+
.tab-content.active {
|
|
446
|
+
display: block;
|
|
447
|
+
}
|
|
448
|
+
@keyframes fadeIn {
|
|
449
|
+
from { opacity: 0; transform: translateY(5px); }
|
|
450
|
+
to { opacity: 1; transform: translateY(0); }
|
|
451
|
+
}
|
|
452
|
+
|
|
48
453
|
.card {
|
|
49
454
|
background: #0d1526;
|
|
50
455
|
border: 0.8px solid #1e2d4a;
|
|
@@ -58,6 +463,7 @@
|
|
|
58
463
|
transition:
|
|
59
464
|
border-color 0.2s,
|
|
60
465
|
transform 0.15s;
|
|
466
|
+
text-decoration: none;
|
|
61
467
|
}
|
|
62
468
|
.card:hover {
|
|
63
469
|
border-color: #42b883;
|
|
@@ -72,11 +478,13 @@
|
|
|
72
478
|
font-weight: 600;
|
|
73
479
|
color: #cbd5e1;
|
|
74
480
|
letter-spacing: 0.01em;
|
|
481
|
+
margin: 0;
|
|
75
482
|
}
|
|
76
483
|
.card p {
|
|
77
484
|
font-size: 1rem;
|
|
78
485
|
color: #38649b;
|
|
79
486
|
line-height: 1.6;
|
|
487
|
+
margin: 0;
|
|
80
488
|
}
|
|
81
489
|
.card-link {
|
|
82
490
|
display: flex;
|
|
@@ -86,8 +494,147 @@
|
|
|
86
494
|
color: #42b883;
|
|
87
495
|
opacity: 0.8;
|
|
88
496
|
transition: opacity 0.15s;
|
|
497
|
+
margin-top: auto;
|
|
89
498
|
}
|
|
90
499
|
.card:hover .card-link {
|
|
91
500
|
opacity: 1;
|
|
92
501
|
}
|
|
502
|
+
|
|
503
|
+
.guide-filter {
|
|
504
|
+
display: flex;
|
|
505
|
+
gap: 0.5rem;
|
|
506
|
+
flex-wrap: wrap;
|
|
507
|
+
justify-content: center;
|
|
508
|
+
margin-bottom: 2rem;
|
|
509
|
+
|
|
510
|
+
label {
|
|
511
|
+
cursor: pointer;
|
|
512
|
+
|
|
513
|
+
input[type="radio"] {
|
|
514
|
+
display: none;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.filter-pill {
|
|
520
|
+
display: inline-block;
|
|
521
|
+
padding: 5px 16px;
|
|
522
|
+
border-radius: 20px;
|
|
523
|
+
border: 0.8px solid #1e2d4a;
|
|
524
|
+
background: #0d1526;
|
|
525
|
+
color: #38649b;
|
|
526
|
+
font-size: 0.9rem;
|
|
527
|
+
transition:
|
|
528
|
+
border-color 0.2s,
|
|
529
|
+
color 0.2s,
|
|
530
|
+
background 0.2s;
|
|
531
|
+
user-select: none;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.guide-filter input[type="radio"]:checked + .filter-pill {
|
|
535
|
+
border-color: #42b883;
|
|
536
|
+
color: #42b883;
|
|
537
|
+
background: rgba(66, 184, 131, 0.08);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
.guide-filter label:hover .filter-pill {
|
|
541
|
+
border-color: #42b883;
|
|
542
|
+
color: #42b883;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/* Markdown Body Styles */
|
|
546
|
+
.markdown-body {
|
|
547
|
+
color: #cbd5e1;
|
|
548
|
+
line-height: 1.6;
|
|
549
|
+
}
|
|
550
|
+
.markdown-body h2 {
|
|
551
|
+
color: #42b883;
|
|
552
|
+
margin-top: 0;
|
|
553
|
+
margin-bottom: 1rem;
|
|
554
|
+
font-size: 1.8rem;
|
|
555
|
+
}
|
|
556
|
+
.markdown-body h3 {
|
|
557
|
+
color: #cbd5e1;
|
|
558
|
+
margin-top: 1.5rem;
|
|
559
|
+
margin-bottom: 0.75rem;
|
|
560
|
+
font-size: 1.3rem;
|
|
561
|
+
}
|
|
562
|
+
.markdown-body h4 {
|
|
563
|
+
color: #cbd5e1;
|
|
564
|
+
margin-top: 1.2rem;
|
|
565
|
+
margin-bottom: 0.5rem;
|
|
566
|
+
font-size: 1.1rem;
|
|
567
|
+
font-weight: 600;
|
|
568
|
+
}
|
|
569
|
+
.markdown-body h4 small {
|
|
570
|
+
color: #8da4c2;
|
|
571
|
+
font-weight: 400;
|
|
572
|
+
font-size: 0.85em;
|
|
573
|
+
}
|
|
574
|
+
.markdown-body p {
|
|
575
|
+
margin-bottom: 1rem;
|
|
576
|
+
color: #8da4c2;
|
|
577
|
+
}
|
|
578
|
+
.markdown-body pre {
|
|
579
|
+
background: #0d1526;
|
|
580
|
+
border: 0.8px solid #1e2d4a;
|
|
581
|
+
padding: 1rem;
|
|
582
|
+
border-radius: 8px;
|
|
583
|
+
overflow-x: auto;
|
|
584
|
+
margin-bottom: 1.5rem;
|
|
585
|
+
}
|
|
586
|
+
.markdown-body pre code {
|
|
587
|
+
background: transparent;
|
|
588
|
+
padding: 0;
|
|
589
|
+
color: #cbd5e1;
|
|
590
|
+
}
|
|
591
|
+
.markdown-body code {
|
|
592
|
+
font-family: monospace;
|
|
593
|
+
background: rgba(66, 184, 131, 0.15);
|
|
594
|
+
color: #42b883;
|
|
595
|
+
padding: 0.2rem 0.4rem;
|
|
596
|
+
border-radius: 4px;
|
|
597
|
+
font-size: 0.9em;
|
|
598
|
+
}
|
|
599
|
+
.markdown-body table {
|
|
600
|
+
width: 100%;
|
|
601
|
+
border-collapse: collapse;
|
|
602
|
+
margin-bottom: 1.5rem;
|
|
603
|
+
font-size: 0.95rem;
|
|
604
|
+
}
|
|
605
|
+
.markdown-body th, .markdown-body td {
|
|
606
|
+
border: 0.8px solid #1e2d4a;
|
|
607
|
+
padding: 0.75rem 1rem;
|
|
608
|
+
text-align: left;
|
|
609
|
+
}
|
|
610
|
+
.markdown-body th {
|
|
611
|
+
background: #0d1526;
|
|
612
|
+
color: #cbd5e1;
|
|
613
|
+
font-weight: 600;
|
|
614
|
+
}
|
|
615
|
+
.markdown-body blockquote {
|
|
616
|
+
border-left: 4px solid #42b883;
|
|
617
|
+
margin: 1.5rem 0;
|
|
618
|
+
padding: 1rem 1.5rem;
|
|
619
|
+
background: rgba(66, 184, 131, 0.05);
|
|
620
|
+
border-radius: 0 8px 8px 0;
|
|
621
|
+
color: #a0aec0;
|
|
622
|
+
}
|
|
93
623
|
</style>
|
|
624
|
+
|
|
625
|
+
<script>
|
|
626
|
+
document.querySelectorAll('input[name="guide-filter"]').forEach((radio) => {
|
|
627
|
+
radio.addEventListener("change", (e) => {
|
|
628
|
+
document.querySelectorAll(".tab-content").forEach((content) => {
|
|
629
|
+
content.classList.remove("active");
|
|
630
|
+
});
|
|
631
|
+
|
|
632
|
+
const targetId = `content-${e.target.value}`;
|
|
633
|
+
const targetContent = document.getElementById(targetId);
|
|
634
|
+
|
|
635
|
+
if (targetContent) {
|
|
636
|
+
targetContent.classList.add("active");
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
});
|
|
640
|
+
</script>
|