diff --git a/.forgejo/workflows/build-deploy.yml b/.forgejo/workflows/build-deploy.yml index 237487b..e27f0ec 100644 --- a/.forgejo/workflows/build-deploy.yml +++ b/.forgejo/workflows/build-deploy.yml @@ -3,11 +3,28 @@ name: Build and Deploy Website on: [push] jobs: + build-dev: + name: Build Website + runs-on: docker + container: + image: node:lts + if: github.ref != 'refs/heads/main' + steps: + - uses: actions/checkout@v4 + - name: Install Dependencies + run: npm install + - name: Build Website + run: npm run build:dev + - uses: actions/upload-artifact@v3 + with: + name: build + path: dist/ build: name: Build Website runs-on: docker container: image: node:lts + if: github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v4 - name: Install Dependencies @@ -23,7 +40,7 @@ jobs: runs-on: docker container: image: node:lts-alpine - needs: [build] + needs: [build-dev] if: github.ref == 'refs/heads/develop' steps: - uses: actions/download-artifact@v3 diff --git a/README.md b/README.md index d8ff99d..f6704d0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # sp-codes.de -[![Build Status](https://ci.sp-codes.de/api/badges/samuel-p/sp-codes.de/status.svg?branch=main)](https://ci.sp-codes.de/samuel-p/sp-codes.de) - Website for [sp-codes.de](https://sp-codes.de) ## Additional Header Parameters diff --git a/package.json b/package.json index 14d1e83..4ac55c8 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "scripts": { "minify-css": "uncss -n -H dist/ -o dist/css/main-*.css dist/**/*.html dist/**/**/*.html dist/**/**/**/*.html dist/**/**/**/**/*.html dist/**/**/**/**/**/*.html", "start": "eleventy --serve --watch", - "build": "eleventy && npm run move-index && npm run minify-css", - "move-index": "cpx dist/de/index.html dist/" + "build": "eleventy && npm run minify-css", + "build:dev": "BUILD=dev eleventy" }, "author": "samuel-p", "repository": { diff --git a/src/_data/global.dev.json b/src/_data/global.dev.json new file mode 100644 index 0000000..fd531ee --- /dev/null +++ b/src/_data/global.dev.json @@ -0,0 +1,4 @@ +{ + "title": "DEV sp-codes", + "url": "https://dev.sp-codes.de" +} diff --git a/src/_data/site.js b/src/_data/site.js index 3c5f555..9f67ce6 100644 --- a/src/_data/site.js +++ b/src/_data/site.js @@ -1,3 +1,10 @@ +const fs = require("fs"); const site = require("./global.json"); -site.buildTime = new Date(); + +site.buildName = process.env.BUILD || 'prod'; +if (fs.existsSync(`${__dirname}/global.${site.buildName}.json`)) { + Object.assign(site, require(`./global.${site.buildName}.json`)); +} +site.buildTime = new Date().toISOString(); + module.exports = site; diff --git a/src/_includes/layouts/base.njk b/src/_includes/layouts/base.njk index 19b1c97..50e0451 100644 --- a/src/_includes/layouts/base.njk +++ b/src/_includes/layouts/base.njk @@ -23,12 +23,12 @@ - + - + diff --git a/src/de/imprint.html b/src/de/imprint.html index 44ab596..a6db719 100644 --- a/src/de/imprint.html +++ b/src/de/imprint.html @@ -15,14 +15,14 @@ summary: Impressum von sp-codes – Informationen zu Rechtsinhaber und Kontaktan

Kontakt

E-Mail-Adresse: mail@sp-codes.de
- Weitere Kontaktmöglichkeiten: https://sp-codes.de/{{locale}}/contact
+ Weitere Kontaktmöglichkeiten: {{ site.url }}/{{locale}}/contact

Domains

diff --git a/src/de/privacy.html b/src/de/privacy.html index 3e5d976..0ad4413 100644 --- a/src/de/privacy.html +++ b/src/de/privacy.html @@ -14,8 +14,8 @@ summary: Datenschutzerklärung von sp-codes – Informationen zur Datenverarbeit

E-Mail-Adresse: mail@sp-codes.de
Kontaktmöglichkeiten: https://sp-codes.de/{{locale}}/contact
- Impressum: https://sp-codes.de/{{locale}}/imprint + href="/{{locale}}/contact">{{ site.url }}/{{locale}}/contact
+ Impressum: {{ site.url }}/{{locale}}/imprint

diff --git a/src/en/imprint.html b/src/en/imprint.html index 0e75861..8563601 100644 --- a/src/en/imprint.html +++ b/src/en/imprint.html @@ -15,14 +15,14 @@ summary: Imprint of sp-codes - Information on legal owner and contact details.

Contact

E-Mail-Address: mail@sp-codes.de
- More contact options: https://sp-codes.de/{{locale}}/contact
+ More contact options: {{ site.url }}/{{locale}}/contact

Domains

diff --git a/src/index.html b/src/index.html new file mode 120000 index 0000000..0a424f8 --- /dev/null +++ b/src/index.html @@ -0,0 +1 @@ +de/index.html \ No newline at end of file