This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
const pug = require("pug");
|
||||||
|
|
||||||
|
module.exports = function (eleventyConfig) {
|
||||||
|
eleventyConfig.addPassthroughCopy("src/assets/img");
|
||||||
|
|
||||||
|
eleventyConfig.addExtension("pug", {
|
||||||
|
compile: (inputContent, inputPath) => {
|
||||||
|
const fn = pug.compile(inputContent, { filename: inputPath });
|
||||||
|
return (data) => fn(data);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
dir: {
|
||||||
|
input: "src",
|
||||||
|
output: "dist",
|
||||||
|
includes: "_includes",
|
||||||
|
data: "_data",
|
||||||
|
},
|
||||||
|
templateFormats: ["pug", "md", "html"],
|
||||||
|
htmlTemplateEngine: "pug",
|
||||||
|
markdownTemplateEngine: "pug",
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
name: build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build site
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Upload build artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
path: dist/
|
||||||
|
|
||||||
|
# Deploy step intentionally not wired up yet: this runner spins up
|
||||||
|
# ephemeral job containers (no host bind-mount for the workspace), so
|
||||||
|
# syncing dist/ to /mnt/e/sites/<site> needs an SSH deploy key added as
|
||||||
|
# a Gitea Actions secret. See repo README for the manual deploy steps
|
||||||
|
# used until that's set up.
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
.cache/
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
# continuum-3d-site
|
||||||
|
|
||||||
|
Landing page for continuum-3d.com. Eleventy + Pug + Tailwind CSS, with a
|
||||||
|
small JSON-based i18n setup (`src/locales/en.json`, `src/locales/pl.json`).
|
||||||
|
|
||||||
|
- English lives at `src/en/index.pug` and builds to `/`.
|
||||||
|
- Polish lives at `src/pl/index.pug` and builds to `/pl/`.
|
||||||
|
- Add more languages by adding `src/locales/<lang>.json` and a
|
||||||
|
`src/<lang>/index.pug` with `lang: <lang>` in its front matter.
|
||||||
|
|
||||||
|
## Develop
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
Output goes to `dist/`.
|
||||||
|
|
||||||
|
## Deploy (manual, for now)
|
||||||
|
|
||||||
|
CI builds and uploads `dist/` as an artifact on every push to `main`, but
|
||||||
|
does not yet sync it to the server automatically — the Gitea act runner
|
||||||
|
uses ephemeral job containers with no host-visible workspace path, so an
|
||||||
|
auto-deploy step needs an SSH deploy key added as a Gitea Actions secret
|
||||||
|
first. Until that's set up, deploy manually:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm run build
|
||||||
|
scp -r dist/* <host>:/mnt/e/sites/continuum-3d-com/
|
||||||
|
```
|
||||||
|
|
||||||
|
Caddy serves `/mnt/e/sites/continuum-3d-com` as the document root for
|
||||||
|
`continuum-3d.com`.
|
||||||
Generated
+2961
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"name": "continuum-3d-site",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"build:11ty": "eleventy",
|
||||||
|
"build:css": "tailwindcss -i ./src/assets/css/tailwind.css -o ./dist/assets/css/style.css --minify",
|
||||||
|
"build": "npm run build:11ty && npm run build:css",
|
||||||
|
"dev": "eleventy --serve"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@11ty/eleventy": "^3.0.0",
|
||||||
|
"pug": "^3.0.3",
|
||||||
|
"tailwindcss": "^3.4.10"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
module.exports = function () {
|
||||||
|
const localesDir = path.join(__dirname, "..", "locales");
|
||||||
|
const dict = {};
|
||||||
|
for (const file of fs.readdirSync(localesDir)) {
|
||||||
|
if (!file.endsWith(".json")) continue;
|
||||||
|
const locale = path.basename(file, ".json");
|
||||||
|
dict[locale] = JSON.parse(fs.readFileSync(path.join(localesDir, file), "utf8"));
|
||||||
|
}
|
||||||
|
return dict;
|
||||||
|
};
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
doctype html
|
||||||
|
html(lang=lang)
|
||||||
|
head
|
||||||
|
meta(charset="UTF-8")
|
||||||
|
meta(name="viewport" content="width=device-width, initial-scale=1.0")
|
||||||
|
title= i18n[lang].meta_title
|
||||||
|
link(rel="stylesheet" href="/assets/css/style.css")
|
||||||
|
body(class="bg-gray-950 text-white antialiased")
|
||||||
|
!= content
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
@tailwind base;
|
||||||
|
@tailwind components;
|
||||||
|
@tailwind utilities;
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
layout: layout.pug
|
||||||
|
lang: en
|
||||||
|
permalink: /
|
||||||
|
---
|
||||||
|
section(class="min-h-screen flex flex-col items-center justify-center px-6 text-center")
|
||||||
|
h1(class="text-5xl font-bold tracking-tight mb-4")= i18n[lang].hero_title
|
||||||
|
p(class="text-lg text-gray-400 max-w-xl mb-10")= i18n[lang].hero_subtitle
|
||||||
|
a(href="/pl/" class="text-sm text-gray-500 hover:text-gray-300 underline underline-offset-4")= i18n[lang].lang_switch_label
|
||||||
|
|
||||||
|
footer(class="pb-8 text-center text-xs text-gray-600")
|
||||||
|
p= i18n[lang].footer_text
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"meta_title": "Continuum 3D",
|
||||||
|
"nav_home": "Home",
|
||||||
|
"hero_title": "Continuum 3D",
|
||||||
|
"hero_subtitle": "3D printing engineering and manufacturing solutions.",
|
||||||
|
"cta_text": "Contact us",
|
||||||
|
"lang_switch_label": "Polski",
|
||||||
|
"lang_switch_href": "/pl/",
|
||||||
|
"footer_text": "Continuum 3D Sp. z o.o."
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"meta_title": "Continuum 3D",
|
||||||
|
"nav_home": "Start",
|
||||||
|
"hero_title": "Continuum 3D",
|
||||||
|
"hero_subtitle": "Inżynieria i produkcja w druku 3D.",
|
||||||
|
"cta_text": "Skontaktuj się",
|
||||||
|
"lang_switch_label": "English",
|
||||||
|
"lang_switch_href": "/",
|
||||||
|
"footer_text": "Continuum 3D Sp. z o.o."
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
layout: layout.pug
|
||||||
|
lang: pl
|
||||||
|
permalink: /pl/
|
||||||
|
---
|
||||||
|
section(class="min-h-screen flex flex-col items-center justify-center px-6 text-center")
|
||||||
|
h1(class="text-5xl font-bold tracking-tight mb-4")= i18n[lang].hero_title
|
||||||
|
p(class="text-lg text-gray-400 max-w-xl mb-10")= i18n[lang].hero_subtitle
|
||||||
|
a(href="/" class="text-sm text-gray-500 hover:text-gray-300 underline underline-offset-4")= i18n[lang].lang_switch_label
|
||||||
|
|
||||||
|
footer(class="pb-8 text-center text-xs text-gray-600")
|
||||||
|
p= i18n[lang].footer_text
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
module.exports = {
|
||||||
|
content: ["./src/**/*.pug"],
|
||||||
|
theme: {
|
||||||
|
extend: {},
|
||||||
|
},
|
||||||
|
plugins: [],
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user