From 48bb34ccfe250fdb794993bf8fd1d9f190f8e5e1 Mon Sep 17 00:00:00 2001 From: valentin gagarin Date: Wed, 13 Nov 2024 15:24:41 +0100 Subject: [PATCH] stricter type for articles --- presentation/default.nix | 5 ++++- structure/content-types.nix | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/presentation/default.nix b/presentation/default.nix index aa0dba42..7c472dd1 100644 --- a/presentation/default.nix +++ b/presentation/default.nix @@ -49,7 +49,10 @@ in head = '' ${page.title} - + ${with lib; join "\n" (map + (author: '''') + (if isList page.author then page.author else [page.author])) + } ''; body = '' ${templates.nav { menu = { menu = config.menus.main; }; }} diff --git a/structure/content-types.nix b/structure/content-types.nix index d396010b..cd9a4716 100644 --- a/structure/content-types.nix +++ b/structure/content-types.nix @@ -95,12 +95,12 @@ in }; date = mkOption { description = "Publication date"; - type = with types; nullOr str; + type = with types; str; default = null; }; author = mkOption { description = "Page author"; - type = with types; nullOr (either str (listOf str)); + type = with types; either str (nonEmptyListOf str); default = null; }; };