aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin <valentin@fricklerhandwerk.de>2025-12-16 23:21:41 +0100
committerValentin <valentin@fricklerhandwerk.de>2025-12-20 17:44:07 +0100
commit0efd609dd832b11c4e4e20c008edc1cc52dbfbd9 (patch)
tree2daea25b800a0733baa6f45fd71afcadf02a9ffc
parent087800e228ac6239dbc287270232fa47344836ca (diff)
Dateiliste verallgemeinert
-rw-r--r--www/html.nix3
-rw-r--r--www/index.nix20
2 files changed, 10 insertions, 13 deletions
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@" = ''<link rel="stylesheet" type="text/css" href="style.css">'';
@@ -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
);
};
};