From ab36912ee135d4897730b31d6e767d51bcf54e40 Mon Sep 17 00:00:00 2001 From: Valentin Date: Tue, 16 Dec 2025 21:42:38 +0100 Subject: Titel auf allen Seiten aus Konfiguration generiert --- www/index.nix | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 www/index.nix (limited to 'www/index.nix') diff --git a/www/index.nix b/www/index.nix new file mode 100644 index 0000000..0d84ec3 --- /dev/null +++ b/www/index.nix @@ -0,0 +1,33 @@ +{ self, ... }: +{ + perSystem = + { ... }: + { + websites.${self.domain} = + { config, lib, ... }: + let + inherit (lib) mkOption types; + replacements = { + "@title@" = config.title; + }; + replace = file: with lib; replaceStrings (attrNames replacements) (attrValues replacements) file; + in + { + files = + with lib; + listToAttrs ( + map + (path: rec { + name = baseNameOf path; + value = with builtins; toFile "index.html" (replace (readFile path)); + }) + [ + ./html/index.html + ./html/vergangene-termine.html + ./html/impressum.html + ./html/datenschutz.html + ] + ); + }; + }; +} -- cgit v1.2.3 From 6c54d824d64a752e48d03e98477047629b392003 Mon Sep 17 00:00:00 2001 From: Valentin Date: Tue, 16 Dec 2025 22:31:29 +0100 Subject: Stylesheet auf allen Seiten angeglichen Dabei kleine Vereinfachungen vorgenommen. --- www/index.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'www/index.nix') diff --git a/www/index.nix b/www/index.nix index 0d84ec3..e2e6528 100644 --- a/www/index.nix +++ b/www/index.nix @@ -9,6 +9,7 @@ inherit (lib) mkOption types; replacements = { "@title@" = config.title; + "@stylesheet@" = ''''; }; replace = file: with lib; replaceStrings (attrNames replacements) (attrValues replacements) file; in -- cgit v1.2.3 From 087800e228ac6239dbc287270232fa47344836ca Mon Sep 17 00:00:00 2001 From: Valentin Date: Tue, 16 Dec 2025 22:36:00 +0100 Subject: Dokumentmetadaten auf allen Seiten angeglichen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Auch Schlüsselwort "Hamburg" hinzugefügt. --- www/index.nix | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'www/index.nix') diff --git a/www/index.nix b/www/index.nix index e2e6528..607a005 100644 --- a/www/index.nix +++ b/www/index.nix @@ -10,6 +10,15 @@ replacements = { "@title@" = config.title; "@stylesheet@" = ''''; + "@head@" = '' + + + + + + + + ''; }; replace = file: with lib; replaceStrings (attrNames replacements) (attrValues replacements) file; in -- cgit v1.2.3 From 0efd609dd832b11c4e4e20c008edc1cc52dbfbd9 Mon Sep 17 00:00:00 2001 From: Valentin Date: Tue, 16 Dec 2025 23:21:41 +0100 Subject: Dateiliste verallgemeinert --- www/index.nix | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'www/index.nix') diff --git a/www/index.nix b/www/index.nix index 607a005..b1b74dd 100644 --- a/www/index.nix +++ b/www/index.nix @@ -7,6 +7,10 @@ { config, lib, ... }: let inherit (lib) mkOption types; + root = ./html; + files = + with lib.fileset; + toList (difference (fileFilter (file: file.hasExt "html") root) ./html/Kalender); replacements = { "@title@" = config.title; "@stylesheet@" = ''''; @@ -23,20 +27,14 @@ replace = file: with lib; replaceStrings (attrNames replacements) (attrValues replacements) file; in { + title = "Stadtteilbeirat Heimfeld"; files = with lib; listToAttrs ( - map - (path: rec { - name = baseNameOf path; - value = with builtins; toFile "index.html" (replace (readFile path)); - }) - [ - ./html/index.html - ./html/vergangene-termine.html - ./html/impressum.html - ./html/datenschutz.html - ] + map (path: { + name = lib.path.removePrefix root path; + value = with builtins; toFile (baseNameOf path) (replace (readFile path)); + }) files ); }; }; -- cgit v1.2.3