From 0f83f8c7cf0d7a82ad694dddf3271a4665effb3b Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 5 Nov 2026 12:16:59 +0000 Subject: [PATCH] =?UTF-8?q?[138]=20Website:=20GitHub-Pages-Workflow=20(Hug?= =?UTF-8?q?o=200.147.9=20extended),=20Links=20=C3=BCber=20relURL=20und=20R?= =?UTF-8?q?ender-Hooks,=20l=C3=A4uft=20auch=20unter=20/DOSSIER/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pages.yml | 51 +++++++++++++++++++++++ website/.gitignore | 1 + website/assets/css/site.css | 10 ++--- website/assets/js/home.js | 4 +- website/assets/jsconfig.json | 10 ----- website/layouts/_markup/render-image.html | 4 ++ website/layouts/_markup/render-link.html | 6 +++ website/layouts/_partials/footer.html | 4 +- website/layouts/_partials/head.html | 6 +-- website/layouts/_partials/header.html | 6 +-- website/layouts/_shortcodes/card.html | 4 +- website/layouts/home.html | 38 ++++++++--------- 12 files changed, 99 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/pages.yml delete mode 100644 website/assets/jsconfig.json create mode 100644 website/layouts/_markup/render-image.html create mode 100644 website/layouts/_markup/render-link.html diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 00000000..481ecbe8 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,51 @@ +# Website (website/) mit Hugo bauen und auf GitHub Pages veröffentlichen ([138]). +# Voraussetzung: in den Repo-Einstellungen Pages → Source: „GitHub Actions". +name: pages + +on: + push: + branches: [master] + paths: + - "website/**" + - ".github/workflows/pages.yml" + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +env: + HUGO_VERSION: "0.147.9" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Hugo extended installieren + run: | + curl -fsSL -o hugo.tar.gz "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" + tar -xzf hugo.tar.gz hugo + ./hugo version + - id: pages + uses: actions/configure-pages@v5 + - name: Bauen + run: ./hugo --source website --minify --panicOnWarning --baseURL "${{ steps.pages.outputs.base_url }}/" + - uses: actions/upload-pages-artifact@v3 + with: + path: website/public + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v4 diff --git a/website/.gitignore b/website/.gitignore index 96a70eee..dabb1e97 100644 --- a/website/.gitignore +++ b/website/.gitignore @@ -1,3 +1,4 @@ /public/ /resources/ .hugo_build.lock +/assets/jsconfig.json diff --git a/website/assets/css/site.css b/website/assets/css/site.css index fa157360..ec1c27a1 100644 --- a/website/assets/css/site.css +++ b/website/assets/css/site.css @@ -2,12 +2,12 @@ Farben und Schriften aus dem Design-Paket (website/_design/DESIGN-PAKET.md): Planpapier, Tusche, Schraffurgrau und das Öffnungsrot aus den Dossier-Plänen. Schriften liegen in /fonts (OFL). */ -@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/schibsted-grotesk-600.woff2") format("woff2"); } -@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/schibsted-grotesk-800.woff2") format("woff2"); } +@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/schibsted-grotesk-600.woff2") format("woff2"); } +@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/schibsted-grotesk-800.woff2") format("woff2"); } /* IBM Plex Sans/Mono, beschnitten und darum umbenannt (reservierter Name, s. NOTICE) */ -@font-face { font-family: "Dossier Text"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-sans-400.woff2") format("woff2"); } -@font-face { font-family: "Dossier Text"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/ibm-plex-sans-500.woff2") format("woff2"); } -@font-face { font-family: "Dossier Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2"); } +@font-face { font-family: "Dossier Text"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2"); } +@font-face { font-family: "Dossier Text"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-500.woff2") format("woff2"); } +@font-face { font-family: "Dossier Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2"); } :root { --canvas: #f2f0e9; diff --git a/website/assets/js/home.js b/website/assets/js/home.js index 113d1246..b81175ee 100644 --- a/website/assets/js/home.js +++ b/website/assets/js/home.js @@ -4,8 +4,8 @@ import { initCommon } from "./common.js"; initCommon(); -const VIDEO_URL = "/hero/hero-scrub.mp4"; -const POSTER_URL = "/hero/hero-poster.jpg"; +const VIDEO_URL = "hero/hero-scrub.mp4"; // relativ zur Startseite (GitHub Pages kann unter /DOSSIER/ liegen) +const POSTER_URL = "hero/hero-poster.jpg"; // Die fünf Bedingungen für die ruhige Startseite, Zeichen für Zeichen wie in home.css const GATES = [ "(max-width: 720px)", diff --git a/website/assets/jsconfig.json b/website/assets/jsconfig.json deleted file mode 100644 index 377218cc..00000000 --- a/website/assets/jsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": ".", - "paths": { - "*": [ - "*" - ] - } - } -} \ No newline at end of file diff --git a/website/layouts/_markup/render-image.html b/website/layouts/_markup/render-image.html new file mode 100644 index 00000000..066c1fa4 --- /dev/null +++ b/website/layouts/_markup/render-image.html @@ -0,0 +1,4 @@ +{{- $u := .Destination -}} +{{- if and (hasPrefix $u "/") (not (hasPrefix $u "//")) }}{{ $u = strings.TrimPrefix "/" $u | relURL }}{{ end -}} +{{ .PlainText }} +{{- /* kein Zeilenumbruch */ -}} diff --git a/website/layouts/_markup/render-link.html b/website/layouts/_markup/render-link.html new file mode 100644 index 00000000..c86035a7 --- /dev/null +++ b/website/layouts/_markup/render-link.html @@ -0,0 +1,6 @@ +{{- /* Root-relative Ziele („/docs/…") auf die baseURL beziehen: die Seite läuft unter + dossier.openbureau.ch und unter expiredtanin.github.io/DOSSIER/. */ -}} +{{- $u := .Destination -}} +{{- if and (hasPrefix $u "/") (not (hasPrefix $u "//")) }}{{ $u = strings.TrimPrefix "/" $u | relURL }}{{ end -}} +{{ .Text }} +{{- /* kein Zeilenumbruch */ -}} diff --git a/website/layouts/_partials/footer.html b/website/layouts/_partials/footer.html index 1d442c6d..10e19027 100644 --- a/website/layouts/_partials/footer.html +++ b/website/layouts/_partials/footer.html @@ -2,8 +2,8 @@ dossier. Lizenz AGPL-3.0 Quellcode auf GitHub - Dokumentation - Stand + Dokumentation + Stand Impressum und Kontakt: openbureau {{- if not .IsHome }}{{ with .File }} Diese Seite im Repo diff --git a/website/layouts/_partials/head.html b/website/layouts/_partials/head.html index 7b4a9ca0..9a0a2c89 100644 --- a/website/layouts/_partials/head.html +++ b/website/layouts/_partials/head.html @@ -5,15 +5,15 @@ - + - - + + {{- $theme := resources.Get "js/theme.js" | js.Build (dict "minify" true) | fingerprint }} {{- $css := resources.Get "css/site.css" | minify | fingerprint }} diff --git a/website/layouts/_partials/header.html b/website/layouts/_partials/header.html index 0aec6d9c..624ebbe8 100644 --- a/website/layouts/_partials/header.html +++ b/website/layouts/_partials/header.html @@ -1,9 +1,9 @@
- dossier. + dossier.