From c1dd3bdfab3115d2c5dc25b8d513d22b2eef2d25 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Tue, 15 Oct 2024 19:40:34 +0200 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 aa0dba4..7c472dd 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 d396010..cd9a471 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; }; };