aboutsummaryrefslogtreecommitdiff
path: root/www/index.nix
diff options
context:
space:
mode:
Diffstat (limited to 'www/index.nix')
-rw-r--r--www/index.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/www/index.nix b/www/index.nix
index d4b1fcc..65f7ddb 100644
--- a/www/index.nix
+++ b/www/index.nix
@@ -10,13 +10,16 @@
root = ./html;
files =
with lib.fileset;
- toList (difference (fileFilter (file: file.hasExt "html") root) ./html/Kalender);
+ toList (
+ difference (fileFilter (file: file.hasExt "html" || file.hasExt "js") root) ./html/Kalender
+ );
replacements =
let
events =
with lib;
let
as-list = mapAttrsToList (name: value: {
+ slug = name;
start = value.date.start + value.time.start;
value = toString value;
}) config.events;
@@ -56,6 +59,11 @@
}
</dl>
'';
+ "@events-redirects@" =
+ with lib;
+ concatMapStringsSep ",\n" (event: ''"${event.slug}": "vergangene-termine.html#${event.slug}"'')
+
+ (filter (event: event.start < config.published) (reverseList events));
};
replace = file: with lib; replaceStrings (attrNames replacements) (attrValues replacements) file;
in