From f0dfefa36eb8c414fed9ce99f06232fdcf6940b4 Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Mon, 1 May 2023 16:22:03 +0200 Subject: [PATCH 1/2] Neue Inhalte nicht als "draft" markieren Bisher haben wir das "draft"-Attribut eher ungewollt genutzt. --- README.md | 2 +- archetypes/default.md | 1 - content/konto/datenschutz/schnipsel.md | 1 - content/konto/datenschutz/teilen.md | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 23b5df2..ca5750e 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Die sind die systemausfall.org-[Hilfeseiten](https://hilfe.systemausfall.org). - Erzeuge einen neuen statischen build mit: ```Shell - hugo -D + hugo ``` - Kopiere das `public`-Verzeichnis auf den entsprechenden Webserver: ```Shell diff --git a/archetypes/default.md b/archetypes/default.md index 00e77bd..7ce2f1a 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -1,6 +1,5 @@ --- title: "{{ replace .Name "-" " " | title }}" date: {{ .Date }} -draft: true --- diff --git a/content/konto/datenschutz/schnipsel.md b/content/konto/datenschutz/schnipsel.md index 5ca4868..9e17893 100644 --- a/content/konto/datenschutz/schnipsel.md +++ b/content/konto/datenschutz/schnipsel.md @@ -1,7 +1,6 @@ --- title: "Schnipsel" date: 2022-11-09T20:14:20+01:00 -draft: true geekdocHidden: true --- diff --git a/content/konto/datenschutz/teilen.md b/content/konto/datenschutz/teilen.md index 9e75b97..d291e59 100644 --- a/content/konto/datenschutz/teilen.md +++ b/content/konto/datenschutz/teilen.md @@ -1,7 +1,6 @@ --- title: "Teilen" date: 2022-11-07T00:12:39+01:00 -draft: true geekdocHidden: true --- From 64d1a830d41d60d83506efc5cbea1860e9aa8a7f Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Mon, 1 May 2023 17:33:11 +0200 Subject: [PATCH 2/2] =?UTF-8?q?build:=20Makefile=20f=C3=BCr=20typische=20O?= =?UTF-8?q?perationen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + Makefile | 46 ++++++++++++++++++++++++++++++++++++++++++++++ README.md | 15 +++++++++++++-- 3 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 78b87b7..ed3eb6b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +build/ public/ resources/_gen .hugo_build.lock diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2be8117 --- /dev/null +++ b/Makefile @@ -0,0 +1,46 @@ +BUILD_DIR ?= build +EXPORT_DIR ?= public +BUILD_STAMP_HUGO = $(BUILD_DIR)/.stamp-hugo +BUILD_STAMP_THEME = $(BUILD_DIR)/.stamp-theme +SOURCE_DIRS = content data resources static +THEME_DIR ?= themes/hugo-geekdoc +BUILD_DEPS = config.toml $(shell find $(wildcard $(SOURCE_DIRS)) -type f) +HUGO_OPTS ?= --destination=$(EXPORT_DIR) + +UPLOAD_SSH_HOST = hosting.sao +UPLOAD_TARGET_DIRECTORY = /data/webserver/hilfe.systemausfall.org/public + + +.PHONY: help +help: + @echo "Mögliche Ziele:" + @echo " build - Webseite erzeugen" + @echo " build-theme - Theme-Assets erzeugen" + @echo " upload - erzeugte Webseite hochladen" + @echo + +.PHONY: build +build: $(BUILD_STAMP_HUGO) + +$(BUILD_STAMP_HUGO): $(BUILD_DEPS) $(BUILD_STAMP_THEME) Makefile + @HUGO_ENV=production hugo $(HUGO_OPTS) + @touch "$@" + +.PHONY: build-theme +build-theme: $(BUILD_STAMP_THEME) + +$(BUILD_STAMP_THEME): + cd "$(THEME_DIR)" \ + && npm install \ + && npm run build + touch "$@" + +.PHONY: upload +upload: $(BUILD_STAMP_HUGO) + @rsync -ax --delete \ + "$(EXPORT_DIR)/" \ + "$(UPLOAD_SSH_HOST):$(UPLOAD_TARGET_DIRECTORY)/" + +.PHONY: clean +clean: + $(RM) -r "$(BUILD_DIR)" diff --git a/README.md b/README.md index ca5750e..f32936e 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,24 @@ Die sind die systemausfall.org-[Hilfeseiten](https://hilfe.systemausfall.org). - Erzeuge einen neuen statischen build mit: ```Shell - hugo + make build ``` - Kopiere das `public`-Verzeichnis auf den entsprechenden Webserver: ```Shell - scp -r public/ hosting.sao:/data/webserver/hilfe.systemausfall.org + make upload ``` + +# Build der Theme-Assets erzwingen + +Nachdem die Theme-Assets initial gebaut wurden, werden spätere Änderungen nicht automatisch +erkannt. +Ein erneutes Erzeugen der Assets kann jedoch erzwungen werden: +```shell +make build-theme +``` + + # Theme anpassen 1. Änderungen im Theme (in `themes/hugo-geekdoc/`) vornehmen, committen und pushen