diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..52de1ae --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,23 @@ +name: Build + +on: + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + container: + image: golang:1.24 + + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Install minify + run: go install github.com/tdewolff/minify/v2/cmd/minify@latest + - name: Install hugo + run: go install github.com/gohugoio/hugo@latest + - name: Run make + run: make diff --git a/Makefile b/Makefile index db53fb5..3071ecc 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,12 @@ -.PHONY: build clean release deploy_test pretty minify +.PHONY: build clean release deploy_test pretty minify check BASEURL ?= https://c3re.de +check: build-check minify + +build-check: clean + hugo --gc --minify --cleanDestinationDir -b "${BASEURL}" --panicOnWarning + release: build minify build: clean diff --git a/config.toml b/config.toml index d77a475..509a3c8 100644 --- a/config.toml +++ b/config.toml @@ -10,15 +10,21 @@ style = "green" [params] mainSections = ["."] +[pagination] +pagerSize = 4 + [[menus.main]] name = "Philosophie" url = "/unsere-philosophie" + [[menus.main]] name = "Codeweek" url = "/codeweek" - - +# [[menus.main]] +# name = "News" +# url = "/news/" +# weight = 80 [[menus.main]] name = "Werkzeuge" @@ -64,4 +70,4 @@ name ="Freifunk Emscherland" url="https://freifunk-emscherland.de/" [[params.footer_rows.items]] name ="Linux User Group Marl" -url="https://www.lug-marl.de/" \ No newline at end of file +url="https://www.lug-marl.de/" diff --git a/content/news/_index.md b/content/news/_index.md new file mode 100644 index 0000000..675e054 --- /dev/null +++ b/content/news/_index.md @@ -0,0 +1,14 @@ +--- +title: "" +date: +tags: [] +categories: [] +weight: 50 +show_comments: false +katex: false +draft: false +description: "" +layout: "newsoverview" +--- + +News diff --git a/content/news/test1.md b/content/news/test1.md new file mode 100644 index 0000000..4db11f0 --- /dev/null +++ b/content/news/test1.md @@ -0,0 +1,13 @@ ++++ +title = "Herbert" +date = "2025-04-28" +categories = ["fisch"] +description = "Einzug" +tags = [ + "test", +] ++++ + +# Einzug + +Hier zieht gerade Herbert die Spinne ein diff --git a/content/news/test2.md b/content/news/test2.md new file mode 100644 index 0000000..4a3b9d2 --- /dev/null +++ b/content/news/test2.md @@ -0,0 +1,11 @@ ++++ +title = "Herbert" +date = "2025-04-26" +description = "Bleibt" +tags = [ +] ++++ + +# Bleibt + +Herbert bleibt noch etwas diff --git a/content/news/test3.md b/content/news/test3.md new file mode 100644 index 0000000..b25eea2 --- /dev/null +++ b/content/news/test3.md @@ -0,0 +1,12 @@ ++++ +title = "Herbert" +date = "2025-04-27" +description = "Zieht aus" +tags = [ + "test", +] ++++ + +# Auszug + +Herbert zieht gerade aus diff --git a/themes/hugo-theme-flat/layouts/_default/newsoverview.html b/themes/hugo-theme-flat/layouts/_default/newsoverview.html new file mode 100644 index 0000000..ecd30e6 --- /dev/null +++ b/themes/hugo-theme-flat/layouts/_default/newsoverview.html @@ -0,0 +1,49 @@ +{{ define "main" }} + +
+
+ {{ $pages := where .Site.RegularPages "Type" "eq" "news" }} + {{ $paginator := .Paginate $pages }} + {{ range $paginator.Pages }} +
+

{{ .Title }}

+ +
+
+ +
+ + {{ with .Params.Categories }} +
+ Categories: + {{ range first 2 . }} + {{ . }} + {{ end }} +
+ {{ end }} + + {{ with .Params.Tags }} +
+ Tags: + {{ range first 5 . }} + {{ . }} + {{ end }} +
+ {{ end }} +
+ +
+ {{ with .Description }} + {{ . }} + {{ else }} + {{ .Summary }} + {{ end }} +
+
+ {{ end }} + +
+ {{ partial "pagination.html" . }} +
+ +{{ end }}