diff options
| author | Valentin <valentin@fricklerhandwerk.de> | 2025-12-16 21:42:38 +0100 |
|---|---|---|
| committer | Valentin <valentin@fricklerhandwerk.de> | 2025-12-20 17:44:07 +0100 |
| commit | ab36912ee135d4897730b31d6e767d51bcf54e40 (patch) | |
| tree | 2893de31834abc12f0f4e2fc2148198efe19d43b /www | |
| parent | 1a99a306ae044625e3f89e16d1d6f809ce8c12e0 (diff) | |
Titel auf allen Seiten aus Konfiguration generiert
Diffstat (limited to 'www')
| -rw-r--r-- | www/framework/default.nix | 6 | ||||
| -rw-r--r-- | www/html.nix | 3 | ||||
| -rw-r--r-- | www/html/datenschutz.html | 2 | ||||
| -rw-r--r-- | www/html/impressum.html | 2 | ||||
| -rw-r--r-- | www/html/index.html | 2 | ||||
| -rw-r--r-- | www/html/vergangene-termine.html | 2 | ||||
| -rw-r--r-- | www/index.nix | 33 |
7 files changed, 45 insertions, 5 deletions
diff --git a/www/framework/default.nix b/www/framework/default.nix index 92e1ed8..0cc9049 100644 --- a/www/framework/default.nix +++ b/www/framework/default.nix @@ -19,6 +19,12 @@ in default = { }; }; + title = mkOption { + description = "Titel, der bei allen Seiten vorangestellt wird"; + type = types.singleLineStr; + readOnly = true; + }; + files = mkOption { description = '' Dateien, aus denen die Website besteht, als Abbildung vom Dateipfad zum Inhalt diff --git a/www/html.nix b/www/html.nix index 6e48e2f..729ea12 100644 --- a/www/html.nix +++ b/www/html.nix @@ -9,10 +9,11 @@ inherit (lib) mkOption types; in { + title = "Stadtteilbeirat Heimfeld"; files = let root = ./html; - files = lib.fileset.toList root; + files = with lib.fileset; toList root; redirects = with lib; mapAttrsToList diff --git a/www/html/datenschutz.html b/www/html/datenschutz.html index e5876e7..b9d1963 100644 --- a/www/html/datenschutz.html +++ b/www/html/datenschutz.html @@ -4,7 +4,7 @@ <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width"> - <title>Datenschutz</title> + <title>@title@ – Datenschutz</title> <link rel="shortcut icon" type="image/x-icon" href="/img/Kraniche-dreh-klein.gif"> </head> diff --git a/www/html/impressum.html b/www/html/impressum.html index e6872db..cdf864e 100644 --- a/www/html/impressum.html +++ b/www/html/impressum.html @@ -4,7 +4,7 @@ <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width"> - <title>Impressum</title> + <title>@title@ – Impressum</title> <link rel="shortcut icon" type="image/x-icon" href="/img/Kraniche-dreh-klein.gif"> </head> diff --git a/www/html/index.html b/www/html/index.html index 967522b..00ec727 100644 --- a/www/html/index.html +++ b/www/html/index.html @@ -6,7 +6,7 @@ <meta name="viewport" content="width=device-width"> <meta name="description" content="Informationen zum Stadtteil Heimfeld und seinem Stadtteilbeirat"> <meta name="keywords" content="Heimfeld, Stadtteil, Stadtteilbeirat, Beirat, Stadtteilfest, Treffpunkthaus"> - <title>Stadtteilbeirat Heimfeld</title> + <title>@title@</title> <link rel="shortcut icon" type="image/x-icon" href="/img/Kraniche-dreh-klein.gif"> <link rel="stylesheet" type="text/css" href="style.css"> <script async src="redirects.js"></script> diff --git a/www/html/vergangene-termine.html b/www/html/vergangene-termine.html index cc9c576..29b711c 100644 --- a/www/html/vergangene-termine.html +++ b/www/html/vergangene-termine.html @@ -6,7 +6,7 @@ <meta name="viewport" content="width=device-width"> <meta name="description" content="Informationen zum Stadtteil Heimfeld und seinem Stadtteilbeirat"> <meta name="keywords" content="Heimfeld, Stadtteil, Stadtteilbeirat, Beirat, Stadtteilfest, Treffpunkthaus"> - <title>Stadtteilbeirat Heimfeld – Vergangene Termine</title> + <title>@title@ – Vergangene Termine</title> <link rel="shortcut icon" type="image/x-icon" href="/img/Kraniche-dreh-klein.gif"> <link rel="stylesheet" type="text/css" href="style.css"> </head> 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 + ] + ); + }; + }; +} |
