create-berna-stencil 1.0.1
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 -0
- package/.eleventyignore +4 -0
- package/.gitignore +2 -0
- package/README.md +31 -0
- package/bin/create.js +96 -0
- package/package.json +71 -0
- package/src/404.njk +16 -0
- package/src/_routes/another-page.njk +9 -0
- package/src/api/configExample.php +28 -0
- package/src/api/sendEmail.php +131 -0
- package/src/assets/brand/favicon.svg +37 -0
- package/src/assets/brand/logo.svg +37 -0
- package/src/components/exampleComponent.njk +12 -0
- package/src/components/global/footer.njk +32 -0
- package/src/components/global/header.njk +15 -0
- package/src/components/layouts/base.njk +100 -0
- package/src/components/layouts/includes.njk +16 -0
- package/src/data/lang.json +32 -0
- package/src/data/site.json +54 -0
- package/src/index.njk +9 -0
- package/src/js/modules/forms/form.js +45 -0
- package/src/js/modules/forms/normalizePhoneNumber.js +42 -0
- package/src/js/modules/forms/textAreaAutoExpand.js +38 -0
- package/src/js/modules/langSwitcher.js +62 -0
- package/src/js/modules/notification.js +39 -0
- package/src/js/pages/404.js +23 -0
- package/src/js/pages/anotherPage.js +23 -0
- package/src/js/pages/homepage.js +25 -0
- package/src/robots.txt +4 -0
- package/src/scss/modules/_animations.scss +25 -0
- package/src/scss/modules/_footer.scss +12 -0
- package/src/scss/modules/_global.scss +40 -0
- package/src/scss/modules/_header.scss +32 -0
- package/src/scss/modules/_mobile.scss +30 -0
- package/src/scss/modules/_notification.scss +56 -0
- package/src/scss/modules/_root.scss +37 -0
- package/src/scss/modules/_typography.scss +15 -0
- package/src/scss/modules/frameworks/_bootstrap.scss +111 -0
- package/src/scss/modules/frameworks/_bulma.scss +110 -0
- package/src/scss/modules/frameworks/_foundation.scss +140 -0
- package/src/scss/modules/frameworks/_uikit.scss +111 -0
- package/src/scss/pages/404.scss +20 -0
- package/src/scss/pages/anotherPage.scss +21 -0
- package/src/scss/pages/homepage.scss +21 -0
- package/src/sitemap.njk +17 -0
- package/tools/assistant.js +127 -0
- package/tools/cleanOutput.js +24 -0
- package/tools/modules/updateData.js +58 -0
- package/tools/modules/updateIncludes.js +45 -0
- package/tools/modules/updateOutputPath.js +91 -0
- package/tools/modules/updatePage.js +150 -0
- package/tools/res/templates.json +56 -0
package/.eleventy.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
const esbuild = require("esbuild");
|
|
2
|
+
const glob = require("glob");
|
|
3
|
+
const Image = require("@11ty/eleventy-img");
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
|
|
7
|
+
const OUTPUT_DIR = "out";
|
|
8
|
+
|
|
9
|
+
module.exports = function (eleventyConfig) {
|
|
10
|
+
|
|
11
|
+
// =====================================================
|
|
12
|
+
// ESBUILD — Bundles and minifies JS files before build
|
|
13
|
+
// =====================================================
|
|
14
|
+
eleventyConfig.on("eleventy.before", async () => {
|
|
15
|
+
const entryPoints = glob.sync("src/js/pages/*.js");
|
|
16
|
+
await esbuild.build({
|
|
17
|
+
entryPoints,
|
|
18
|
+
bundle: true,
|
|
19
|
+
outdir: `${OUTPUT_DIR}/js/pages`,
|
|
20
|
+
minify: true,
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// =====================================================
|
|
25
|
+
// PASSTHROUGH — Static files
|
|
26
|
+
// =====================================================
|
|
27
|
+
eleventyConfig.addPassthroughCopy("src/api");
|
|
28
|
+
eleventyConfig.addPassthroughCopy("src/assets");
|
|
29
|
+
eleventyConfig.addPassthroughCopy("src/robots.txt");
|
|
30
|
+
|
|
31
|
+
eleventyConfig.addPassthroughCopy({
|
|
32
|
+
// Bootstrap
|
|
33
|
+
"node_modules/bootstrap/dist/js/bootstrap.bundle.min.js": "js/bootstrap.bundle.min.js",
|
|
34
|
+
"node_modules/bootstrap-icons/font/fonts": "css/fonts",
|
|
35
|
+
|
|
36
|
+
// Foundation
|
|
37
|
+
// "node_modules/foundation-sites/dist/js/foundation.min.js": "js/foundation.min.js",
|
|
38
|
+
|
|
39
|
+
// UIkit
|
|
40
|
+
// "node_modules/uikit/dist/js/uikit.min.js": "js/uikit.min.js",
|
|
41
|
+
// "node_modules/uikit/dist/js/uikit-icons.min.js": "js/uikit-icons.min.js",
|
|
42
|
+
|
|
43
|
+
// Bulma — CSS only, no JS passthrough needed
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
eleventyConfig.addPassthroughCopy({ "src/data/lang.json": "data/lang.json" });
|
|
47
|
+
|
|
48
|
+
// =====================================================
|
|
49
|
+
// ELEVENTY IMAGE — Responsive images
|
|
50
|
+
// =====================================================
|
|
51
|
+
eleventyConfig.addShortcode("image", async function (src, alt) {
|
|
52
|
+
let metadata = await Image(src, {
|
|
53
|
+
widths: [320, 480, 720, 1280, 1920, 2048, 2560, 3840, 4096, 7680],
|
|
54
|
+
formats: ["webp", "jpeg"],
|
|
55
|
+
outputDir: `${OUTPUT_DIR}/assets/images/`,
|
|
56
|
+
urlPath: "/assets/images/",
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
return Image.generateHTML(metadata, {
|
|
60
|
+
alt,
|
|
61
|
+
sizes: "(max-width: 768px) 100vw, 50vw",
|
|
62
|
+
loading: "lazy",
|
|
63
|
+
decoding: "async",
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// =====================================================
|
|
68
|
+
// WATCH & DIRECTORY CONFIG
|
|
69
|
+
// =====================================================
|
|
70
|
+
eleventyConfig.addWatchTarget("./src/scss");
|
|
71
|
+
|
|
72
|
+
return {
|
|
73
|
+
dir: {
|
|
74
|
+
input: "src",
|
|
75
|
+
output: OUTPUT_DIR,
|
|
76
|
+
includes: "components",
|
|
77
|
+
layouts: "components/layouts",
|
|
78
|
+
data: "data",
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
};
|
package/.eleventyignore
ADDED
package/.gitignore
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# 🏗️ Berna-Stencil
|
|
2
|
+
A professional boilerplate for Eleventy, lightweight and structure-focused, ready to scale.
|
|
3
|
+
|
|
4
|
+

|
|
5
|
+

|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
## Prerequisites
|
|
9
|
+
* **Node.js**: v18.0.0 or higher
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
* Open your IDE (e.g. Visual Studio Code), open the folder that contains your websites and open a new terminal
|
|
13
|
+
* Run the command for your system to download the project and install everything:
|
|
14
|
+
#### Windows
|
|
15
|
+
```bash
|
|
16
|
+
if (!(Test-Path "$env:APPDATA\npm")) { mkdir "$env:APPDATA\npm" }; $DIR="my-site"; npx -y degit rhaastrake/berna-stencil $DIR; cd $DIR;
|
|
17
|
+
```
|
|
18
|
+
#### MacOS / Linux
|
|
19
|
+
```bash
|
|
20
|
+
DIR="my-site"; npx -y degit rhaastrake/berna-stencil $DIR && cd $DIR
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
* Install all the node_modules
|
|
24
|
+
```bash
|
|
25
|
+
npm install
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
* Run the command to launch the live server and build the site, then visit localhost:8080:
|
|
29
|
+
```bash
|
|
30
|
+
npm run serve
|
|
31
|
+
```
|
package/bin/create.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const targetDir = process.argv[2] ? path.resolve(process.argv[2]) : process.cwd();
|
|
7
|
+
const templateDir = path.join(__dirname, '..');
|
|
8
|
+
|
|
9
|
+
const COPY_TARGETS = [
|
|
10
|
+
'src',
|
|
11
|
+
'tools',
|
|
12
|
+
'.eleventy.js',
|
|
13
|
+
'.eleventyignore',
|
|
14
|
+
'.gitignore',
|
|
15
|
+
'README.md',
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
const PROJECT_PACKAGE = {
|
|
19
|
+
name: path.basename(targetDir),
|
|
20
|
+
version: '1.0.1',
|
|
21
|
+
private: true,
|
|
22
|
+
scripts: {
|
|
23
|
+
'build:css': 'sass src/scss:out/css --no-source-map --style=compressed --quiet',
|
|
24
|
+
'build:js': 'esbuild "src/js/pages/*.js" --bundle --outdir=out/js/pages --minify',
|
|
25
|
+
'build:11ty': 'eleventy',
|
|
26
|
+
'build': 'npm run build:css && npm run build:js && npm run build:11ty',
|
|
27
|
+
'serve:css': 'sass --watch src/scss:out/css --no-source-map --quiet',
|
|
28
|
+
'serve:js': 'esbuild "src/js/pages/*.js" --bundle --outdir=out/js/pages --watch',
|
|
29
|
+
'serve:11ty': 'eleventy --serve --quiet',
|
|
30
|
+
'clean': 'node tools/cleanOutput.js',
|
|
31
|
+
'serve': 'npm run clean && concurrently "npm run serve:11ty" "npm run serve:css" "npm run serve:js"',
|
|
32
|
+
'assistant': 'node tools/assistant.js',
|
|
33
|
+
},
|
|
34
|
+
dependencies: {
|
|
35
|
+
'@11ty/eleventy': '^3.1.2',
|
|
36
|
+
'@11ty/eleventy-img': '^6.0.4',
|
|
37
|
+
'bootstrap': '^5.3.8',
|
|
38
|
+
'bootstrap-icons': '^1.13.1',
|
|
39
|
+
'bulma': '^1.0.4',
|
|
40
|
+
'foundation-sites': '^6.9.0',
|
|
41
|
+
'glob': '^13.0.6',
|
|
42
|
+
'uikit': '^3.25.13',
|
|
43
|
+
},
|
|
44
|
+
devDependencies: {
|
|
45
|
+
'concurrently': '^9.2.1',
|
|
46
|
+
'esbuild': '^0.27.3',
|
|
47
|
+
'sass': '^1.77.0',
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const { writeSync } = require('fs');
|
|
52
|
+
|
|
53
|
+
function log(msg) {
|
|
54
|
+
writeSync(1, msg + '\n');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function copyRecursive(src, dest) {
|
|
58
|
+
const stat = fs.statSync(src);
|
|
59
|
+
if (stat.isDirectory()) {
|
|
60
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
61
|
+
for (const child of fs.readdirSync(src)) {
|
|
62
|
+
copyRecursive(path.join(src, child), path.join(dest, child));
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
66
|
+
fs.copyFileSync(src, dest);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (!fs.existsSync(targetDir)) {
|
|
71
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
log(`\n>> Creating berna-stencil project in ${targetDir}\n`);
|
|
75
|
+
|
|
76
|
+
for (const target of COPY_TARGETS) {
|
|
77
|
+
const src = path.join(templateDir, target);
|
|
78
|
+
const dest = path.join(targetDir, target);
|
|
79
|
+
if (fs.existsSync(src)) {
|
|
80
|
+
copyRecursive(src, dest);
|
|
81
|
+
log(`+ ${target}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
fs.writeFileSync(
|
|
86
|
+
path.join(targetDir, 'package.json'),
|
|
87
|
+
JSON.stringify(PROJECT_PACKAGE, null, 2)
|
|
88
|
+
);
|
|
89
|
+
log('+ package.json');
|
|
90
|
+
|
|
91
|
+
log(`\n>> Done! Now run:\n`);
|
|
92
|
+
if (process.argv[2]) {
|
|
93
|
+
log(`cd ${process.argv[2]}`);
|
|
94
|
+
}
|
|
95
|
+
log('npm install');
|
|
96
|
+
log('npm run serve\n');
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-berna-stencil",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Eleventy boilerplate with per-page SCSS/JS pipeline, esbuild bundling, multi-framework CSS support and a built-in page management CLI",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"eleventy",
|
|
7
|
+
"11ty",
|
|
8
|
+
"boilerplate",
|
|
9
|
+
"starter",
|
|
10
|
+
"scss",
|
|
11
|
+
"esbuild",
|
|
12
|
+
"bootstrap",
|
|
13
|
+
"bulma",
|
|
14
|
+
"foundation",
|
|
15
|
+
"uikit",
|
|
16
|
+
"static-site",
|
|
17
|
+
"nunjucks"
|
|
18
|
+
],
|
|
19
|
+
"author": "Michele Garofalo",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/rhaastrake/berna-stencil"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/rhaastrake/berna-stencil#readme",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/rhaastrake/berna-stencil/issues"
|
|
28
|
+
},
|
|
29
|
+
"bin": {
|
|
30
|
+
"create-berna-stencil": "bin/create.js"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"bin/",
|
|
34
|
+
"src/",
|
|
35
|
+
"tools/",
|
|
36
|
+
".eleventy.js",
|
|
37
|
+
".eleventyignore",
|
|
38
|
+
".gitignore",
|
|
39
|
+
"README.md"
|
|
40
|
+
],
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=18.0.0"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@11ty/eleventy": "^3.1.2",
|
|
46
|
+
"@11ty/eleventy-img": "^6.0.4",
|
|
47
|
+
"bootstrap": "^5.3.8",
|
|
48
|
+
"bootstrap-icons": "^1.13.1",
|
|
49
|
+
"bulma": "^1.0.4",
|
|
50
|
+
"foundation-sites": "^6.9.0",
|
|
51
|
+
"glob": "^13.0.6",
|
|
52
|
+
"uikit": "^3.25.13"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"concurrently": "^9.2.1",
|
|
56
|
+
"esbuild": "^0.27.3",
|
|
57
|
+
"sass": "^1.77.0"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build:css": "sass src/scss:out/css --no-source-map --style=compressed --quiet",
|
|
61
|
+
"build:js": "esbuild \"src/js/pages/*.js\" --bundle --outdir=out/js/pages --minify",
|
|
62
|
+
"build:11ty": "eleventy",
|
|
63
|
+
"build": "npm run build:css && npm run build:js && npm run build:11ty",
|
|
64
|
+
"serve:css": "sass --watch src/scss:out/css --no-source-map --quiet",
|
|
65
|
+
"serve:js": "esbuild \"src/js/pages/*.js\" --bundle --outdir=out/js/pages --watch",
|
|
66
|
+
"serve:11ty": "eleventy --serve --quiet",
|
|
67
|
+
"clean": "node tools/cleanOutput.js",
|
|
68
|
+
"serve": "npm run clean && concurrently \"npm run serve:11ty\" \"npm run serve:css\" \"npm run serve:js\"",
|
|
69
|
+
"assistant": "node tools/assistant.js"
|
|
70
|
+
}
|
|
71
|
+
}
|
package/src/404.njk
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "404"
|
|
3
|
+
permalink: 404.html
|
|
4
|
+
layout: base.njk
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<!-- !IMPORTANT -->
|
|
8
|
+
<!-- This is the only page that you need to modify statically -->
|
|
9
|
+
|
|
10
|
+
<div class="container fade-in">
|
|
11
|
+
<h1 data-lang-key="error404Message"></h1>
|
|
12
|
+
<div><a href="/" data-lang-key="error404Return"></a></div>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
{# You can also add the includes you need here below
|
|
16
|
+
{% include "_exampleComponent.njk" %} #}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
// IMPORTANT!
|
|
4
|
+
// You should fill this file with your data and rename it to config.php
|
|
5
|
+
|
|
6
|
+
// SMTP Configuration
|
|
7
|
+
|
|
8
|
+
// Email address you want to send from (must be configured with the SMTP provider)
|
|
9
|
+
define('MAIL_USERNAME', 'youremail@gmail.com');
|
|
10
|
+
|
|
11
|
+
// Password for the above email address (or an app-specific password if using Gmail with 2FA)
|
|
12
|
+
define('MAIL_PASSWORD', 'password');
|
|
13
|
+
|
|
14
|
+
// SMPT server host (e.g., smtp.gmail.com for Gmail)
|
|
15
|
+
define('MAIL_HOST', 'smtp.gmail.com');
|
|
16
|
+
|
|
17
|
+
// SMPT port (587 for TLS, 465 for SSL)
|
|
18
|
+
define('MAIL_PORT', 587);
|
|
19
|
+
|
|
20
|
+
// Email address you want to send to (you can use the same as MAIL_USERNAME if you want to send to yourself)
|
|
21
|
+
define('MAIL_TO_ADDRESS', 'youremail@gmail.com');
|
|
22
|
+
|
|
23
|
+
// From: name that will appear in the recipient's inbox
|
|
24
|
+
define('MAIL_FROM_NAME', 'Your website');
|
|
25
|
+
|
|
26
|
+
// To: name that will appear in the recipient's inbox
|
|
27
|
+
define('MAIL_TO_NAME', 'Receiver');
|
|
28
|
+
?>
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
//==========================
|
|
4
|
+
// SECURITY: METHOD CHECK
|
|
5
|
+
//==========================
|
|
6
|
+
|
|
7
|
+
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
|
8
|
+
http_response_code(405);
|
|
9
|
+
echo 'Method not allowed (PHP RESPONSE)';
|
|
10
|
+
exit;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
//==========================
|
|
15
|
+
// SECURITY: ORIGIN CHECK
|
|
16
|
+
//==========================
|
|
17
|
+
|
|
18
|
+
// Do not forget to add a ,
|
|
19
|
+
$allowedDomains = [
|
|
20
|
+
'www.yourorigin.com',
|
|
21
|
+
// 'www.anotherorigin.com',
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
$origin = $_SERVER['HTTP_ORIGIN'] ?? '';
|
|
25
|
+
$referer = $_SERVER['HTTP_REFERER'] ?? '';
|
|
26
|
+
|
|
27
|
+
$host = parse_url($origin ?: $referer, PHP_URL_HOST);
|
|
28
|
+
|
|
29
|
+
if (!$host || !in_array($host, $allowedDomains)) {
|
|
30
|
+
http_response_code(403);
|
|
31
|
+
echo 'Forbidden origin (PHP RESPONSE)';
|
|
32
|
+
exit;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
//==========================
|
|
37
|
+
// DEPENDENCIES
|
|
38
|
+
//==========================
|
|
39
|
+
|
|
40
|
+
use PHPMailer\PHPMailer;
|
|
41
|
+
use PHPMailer\Exception;
|
|
42
|
+
|
|
43
|
+
require __DIR__ . '/vendor/autoload.php';
|
|
44
|
+
require __DIR__ . '/config.php';
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
//==========================
|
|
48
|
+
// SANITIZATION FUNCTIONS
|
|
49
|
+
//==========================
|
|
50
|
+
|
|
51
|
+
function clean($value) {
|
|
52
|
+
return htmlspecialchars(trim($value ?? ''), ENT_QUOTES, 'UTF-8');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function safeNum($value) {
|
|
56
|
+
return filter_var($value ?? '', FILTER_SANITIZE_NUMBER_INT);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
//==========================
|
|
61
|
+
// POST VARIABLES
|
|
62
|
+
//==========================
|
|
63
|
+
|
|
64
|
+
// If the variable name exists, it will be concatenated in the body of the mail
|
|
65
|
+
// If it does not exist, it doesn't matter
|
|
66
|
+
|
|
67
|
+
$formType = clean($_POST['formType'] ?? '');
|
|
68
|
+
|
|
69
|
+
$name = clean($_POST['name'] ?? '');
|
|
70
|
+
$phoneNumber = safeNum($_POST['phoneNumber'] ?? '');
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
//==========================
|
|
74
|
+
// MAIL SETUP
|
|
75
|
+
//==========================
|
|
76
|
+
|
|
77
|
+
$mail = new PHPMailer(true);
|
|
78
|
+
|
|
79
|
+
try {
|
|
80
|
+
$mail->isSMTP();
|
|
81
|
+
$mail->Host = MAIL_HOST;
|
|
82
|
+
$mail->SMTPAuth = true;
|
|
83
|
+
$mail->Username = MAIL_USERNAME;
|
|
84
|
+
$mail->Password = MAIL_PASSWORD;
|
|
85
|
+
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
|
86
|
+
$mail->Port = MAIL_PORT;
|
|
87
|
+
$mail->CharSet = 'UTF-8';
|
|
88
|
+
$mail->Encoding = 'base64';
|
|
89
|
+
|
|
90
|
+
$mail->setFrom(MAIL_USERNAME, MAIL_FROM_NAME);
|
|
91
|
+
$mail->addAddress(MAIL_TO_ADDRESS, MAIL_TO_NAME);
|
|
92
|
+
|
|
93
|
+
$mail->isHTML(true);
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
//==========================
|
|
97
|
+
// MAIL BODY
|
|
98
|
+
//==========================
|
|
99
|
+
|
|
100
|
+
$body = "";
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
//==========================
|
|
104
|
+
// DATA CHECKS AND CONCATENATION
|
|
105
|
+
//==========================
|
|
106
|
+
|
|
107
|
+
if (!empty($name)) {
|
|
108
|
+
$body .= "<p><strong>Name:</strong> {$name}</p>";
|
|
109
|
+
}
|
|
110
|
+
if (!empty($phoneNumber)) {
|
|
111
|
+
$body .= "<p><strong>Phone Number:</strong> {$phoneNumber}</p>";
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
//==========================
|
|
115
|
+
// MAIL CONTENT
|
|
116
|
+
//==========================
|
|
117
|
+
|
|
118
|
+
$mail->Subject = "New form submission ({$formType})";
|
|
119
|
+
|
|
120
|
+
$mail->Body = $body;
|
|
121
|
+
$mail->AltBody = strip_tags(str_replace('<br>', "\n", $body));
|
|
122
|
+
|
|
123
|
+
$mail->send();
|
|
124
|
+
|
|
125
|
+
http_response_code(200);
|
|
126
|
+
echo "success";
|
|
127
|
+
|
|
128
|
+
} catch (Exception $e) {
|
|
129
|
+
http_response_code(500);
|
|
130
|
+
echo "{$mail->ErrorInfo}";
|
|
131
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
|
3
|
+
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
|
4
|
+
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000"
|
|
6
|
+
preserveAspectRatio="xMidYMid meet">
|
|
7
|
+
|
|
8
|
+
<g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
|
|
9
|
+
fill="#000000" stroke="none">
|
|
10
|
+
<path d="M4115 4094 c-89 -20 -232 -88 -312 -148 -181 -137 -273 -342 -273
|
|
11
|
+
-604 0 -219 128 -459 353 -664 263 -240 347 -334 403 -451 109 -228 39 -489
|
|
12
|
+
-159 -585 -79 -38 -146 -52 -256 -52 -97 0 -138 10 -192 49 -84 59 -111 136
|
|
13
|
+
-111 311 1 105 6 145 32 250 33 131 47 249 36 295 -16 63 -169 74 -276 20
|
|
14
|
+
-134 -68 -289 -290 -347 -495 -27 -99 -25 -318 6 -425 25 -89 86 -210 133
|
|
15
|
+
-264 94 -107 240 -195 380 -231 421 -105 942 41 1226 345 148 158 218 306 242
|
|
16
|
+
512 25 217 -30 446 -151 624 -54 80 -191 222 -303 314 -47 39 -85 73 -86 78 0
|
|
17
|
+
4 8 7 18 7 9 0 54 13 99 29 174 60 304 196 349 366 31 113 9 324 -44 435 -58
|
|
18
|
+
120 -206 234 -360 276 -84 23 -318 28 -407 8z m348 -407 c82 -41 102 -74 101
|
|
19
|
+
-167 -1 -126 -55 -253 -163 -384 -30 -36 -58 -66 -62 -66 -10 0 -150 149 -200
|
|
20
|
+
215 -51 67 -102 161 -131 245 l-19 55 51 47 c71 66 143 89 270 85 81 -2 104
|
|
21
|
+
-7 153 -30z"/>
|
|
22
|
+
<path d="M1272 4089 c-123 -17 -291 -64 -406 -115 -240 -105 -461 -289 -527
|
|
23
|
+
-439 -24 -53 -18 -82 17 -91 52 -13 121 8 279 82 280 134 441 180 664 191 275
|
|
24
|
+
13 500 -56 597 -184 63 -82 78 -142 78 -293 0 -173 -27 -273 -98 -357 -25 -30
|
|
25
|
+
-27 -30 -78 -21 -73 14 -281 4 -347 -17 -136 -42 -183 -165 -100 -259 17 -20
|
|
26
|
+
54 -45 87 -58 52 -21 74 -23 236 -24 l179 0 29 -35 c16 -19 47 -70 68 -114 50
|
|
27
|
+
-101 71 -217 71 -390 1 -197 -28 -282 -133 -392 -72 -74 -205 -146 -313 -168
|
|
28
|
+
-113 -24 -286 -19 -434 11 -69 14 -130 29 -135 34 -10 10 17 511 35 655 6 44
|
|
29
|
+
35 192 65 329 116 528 158 835 136 981 -13 79 -24 95 -66 95 -73 0 -183 -92
|
|
30
|
+
-268 -224 -194 -302 -402 -1027 -423 -1473 -3 -65 -8 -136 -11 -159 l-5 -40
|
|
31
|
+
-102 23 c-127 29 -207 30 -230 5 -23 -25 -21 -87 4 -139 39 -80 189 -197 352
|
|
32
|
+
-273 158 -74 446 -163 629 -194 386 -67 797 -21 1081 120 163 81 273 175 363
|
|
33
|
+
311 103 155 135 295 116 518 -13 158 -40 248 -104 355 -52 87 -182 216 -290
|
|
34
|
+
286 l-78 51 63 41 c292 190 399 490 296 829 -84 276 -354 466 -751 528 -124
|
|
35
|
+
20 -444 28 -546 14z"/>
|
|
36
|
+
</g>
|
|
37
|
+
</svg>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
|
3
|
+
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
|
4
|
+
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000"
|
|
6
|
+
preserveAspectRatio="xMidYMid meet">
|
|
7
|
+
|
|
8
|
+
<g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
|
|
9
|
+
fill="#000000" stroke="none">
|
|
10
|
+
<path d="M4115 4094 c-89 -20 -232 -88 -312 -148 -181 -137 -273 -342 -273
|
|
11
|
+
-604 0 -219 128 -459 353 -664 263 -240 347 -334 403 -451 109 -228 39 -489
|
|
12
|
+
-159 -585 -79 -38 -146 -52 -256 -52 -97 0 -138 10 -192 49 -84 59 -111 136
|
|
13
|
+
-111 311 1 105 6 145 32 250 33 131 47 249 36 295 -16 63 -169 74 -276 20
|
|
14
|
+
-134 -68 -289 -290 -347 -495 -27 -99 -25 -318 6 -425 25 -89 86 -210 133
|
|
15
|
+
-264 94 -107 240 -195 380 -231 421 -105 942 41 1226 345 148 158 218 306 242
|
|
16
|
+
512 25 217 -30 446 -151 624 -54 80 -191 222 -303 314 -47 39 -85 73 -86 78 0
|
|
17
|
+
4 8 7 18 7 9 0 54 13 99 29 174 60 304 196 349 366 31 113 9 324 -44 435 -58
|
|
18
|
+
120 -206 234 -360 276 -84 23 -318 28 -407 8z m348 -407 c82 -41 102 -74 101
|
|
19
|
+
-167 -1 -126 -55 -253 -163 -384 -30 -36 -58 -66 -62 -66 -10 0 -150 149 -200
|
|
20
|
+
215 -51 67 -102 161 -131 245 l-19 55 51 47 c71 66 143 89 270 85 81 -2 104
|
|
21
|
+
-7 153 -30z"/>
|
|
22
|
+
<path d="M1272 4089 c-123 -17 -291 -64 -406 -115 -240 -105 -461 -289 -527
|
|
23
|
+
-439 -24 -53 -18 -82 17 -91 52 -13 121 8 279 82 280 134 441 180 664 191 275
|
|
24
|
+
13 500 -56 597 -184 63 -82 78 -142 78 -293 0 -173 -27 -273 -98 -357 -25 -30
|
|
25
|
+
-27 -30 -78 -21 -73 14 -281 4 -347 -17 -136 -42 -183 -165 -100 -259 17 -20
|
|
26
|
+
54 -45 87 -58 52 -21 74 -23 236 -24 l179 0 29 -35 c16 -19 47 -70 68 -114 50
|
|
27
|
+
-101 71 -217 71 -390 1 -197 -28 -282 -133 -392 -72 -74 -205 -146 -313 -168
|
|
28
|
+
-113 -24 -286 -19 -434 11 -69 14 -130 29 -135 34 -10 10 17 511 35 655 6 44
|
|
29
|
+
35 192 65 329 116 528 158 835 136 981 -13 79 -24 95 -66 95 -73 0 -183 -92
|
|
30
|
+
-268 -224 -194 -302 -402 -1027 -423 -1473 -3 -65 -8 -136 -11 -159 l-5 -40
|
|
31
|
+
-102 23 c-127 29 -207 30 -230 5 -23 -25 -21 -87 4 -139 39 -80 189 -197 352
|
|
32
|
+
-273 158 -74 446 -163 629 -194 386 -67 797 -21 1081 120 163 81 273 175 363
|
|
33
|
+
311 103 155 135 295 116 518 -13 158 -40 248 -104 355 -52 87 -182 216 -290
|
|
34
|
+
286 l-78 51 63 41 c292 190 399 490 296 829 -84 276 -354 466 -751 528 -124
|
|
35
|
+
20 -444 28 -546 14z"/>
|
|
36
|
+
</g>
|
|
37
|
+
</svg>
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
<input type="radio" class="btn-check" name="lang-switcher" id="lang-en" value="en"/>
|
|
7
|
+
<label class="btn btn-outline-primary" for="lang-en" data-lang-key="enLangName"></label>
|
|
8
|
+
|
|
9
|
+
<input type="radio" class="btn-check" name="lang-switcher" id="lang-it" value="it"/>
|
|
10
|
+
<label class="btn btn-outline-primary" for="lang-it" data-lang-key="itLangName"></label>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<footer>
|
|
2
|
+
<div class="row">
|
|
3
|
+
<div class="col-lg-4">
|
|
4
|
+
<h6 class="mb-3">{{ site.title }}</h6>
|
|
5
|
+
<p>{{ site.description }}</p>
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<hr class="my-3" />
|
|
10
|
+
|
|
11
|
+
<div class="row">
|
|
12
|
+
<div class="col-md-6">
|
|
13
|
+
<p>
|
|
14
|
+
© {{ 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>
|
|
31
|
+
</div>
|
|
32
|
+
</footer>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<header>
|
|
2
|
+
<nav>
|
|
3
|
+
<a class="logo" href="/">
|
|
4
|
+
<img src="{{ site.logo }}" alt="{{ site.title }}" height="40">
|
|
5
|
+
</a>
|
|
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>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="nav-links">
|
|
11
|
+
<a class="btn btn-primary" href="/">ExtraBtn1</a>
|
|
12
|
+
<a class="btn btn-primary" href="/">ExtraBtn2</a>
|
|
13
|
+
</div>
|
|
14
|
+
</nav>
|
|
15
|
+
</header>
|