From 0efd609dd832b11c4e4e20c008edc1cc52dbfbd9 Mon Sep 17 00:00:00 2001 From: Valentin Date: Tue, 16 Dec 2025 23:21:41 +0100 Subject: Dateiliste verallgemeinert --- www/html.nix | 3 +-- www/index.nix | 20 +++++++++----------- 2 files changed, 10 insertions(+), 13 deletions(-) (limited to 'www') diff --git a/www/html.nix b/www/html.nix index 729ea12..97cf089 100644 --- a/www/html.nix +++ b/www/html.nix @@ -9,7 +9,6 @@ inherit (lib) mkOption types; in { - title = "Stadtteilbeirat Heimfeld"; files = let root = ./html; @@ -49,7 +48,7 @@ redirects ++ map (file: { name = lib.path.removePrefix root file; - value = file; + value = lib.mkDefault file; }) files ); }; 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