Scaffold Eleventy + Pug + Tailwind + i18n landing page
build / build (push) Failing after 2m5s

This commit is contained in:
Claude
2026-08-02 01:37:49 +02:00
commit 90af2ff911
14 changed files with 3155 additions and 0 deletions
+24
View File
@@ -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",
};
};
+34
View File
@@ -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.
+3
View File
@@ -0,0 +1,3 @@
node_modules/
dist/
.cache/
+41
View File
@@ -0,0 +1,41 @@
# octoturge-site
Landing page for octoturge.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/octoturge-com/
```
Caddy serves `/mnt/e/sites/octoturge-com` as the document root for
`octoturge.com`.
+2961
View File
File diff suppressed because it is too large Load Diff
+16
View File
@@ -0,0 +1,16 @@
{
"name": "octoturge-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"
}
}
+13
View File
@@ -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;
};
+9
View File
@@ -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
+3
View File
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
+12
View File
@@ -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
+10
View File
@@ -0,0 +1,10 @@
{
"meta_title": "Octoturge",
"nav_home": "Home",
"hero_title": "Octoturge",
"hero_subtitle": "Personal homelab, self-hosted services, and side projects.",
"cta_text": "Explore",
"lang_switch_label": "Polski",
"lang_switch_href": "/pl/",
"footer_text": "Built with Eleventy, Pug & Tailwind CSS."
}
+10
View File
@@ -0,0 +1,10 @@
{
"meta_title": "Octoturge",
"nav_home": "Start",
"hero_title": "Octoturge",
"hero_subtitle": "Prywatny homelab, samodzielnie hostowane usługi i projekty poboczne.",
"cta_text": "Zobacz",
"lang_switch_label": "English",
"lang_switch_href": "/",
"footer_text": "Zbudowane w Eleventy, Pug i Tailwind CSS."
}
+12
View File
@@ -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
+7
View File
@@ -0,0 +1,7 @@
module.exports = {
content: ["./src/**/*.pug"],
theme: {
extend: {},
},
plugins: [],
};