From 4a7db7c5f2a04f3a54aa62226c569afb29ecf0a5 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin <valentin@gagarin.work> 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 aa0dba42..7c472dd1 100644 --- a/presentation/default.nix +++ b/presentation/default.nix @@ -49,7 +49,10 @@ in head = '' <title>${page.title}</title> <meta name="description" content="${page.description}" /> - <meta name="author" content="${with lib; if isList page.author then join ", " page.author else page.author}" /> + ${with lib; join "\n" (map + (author: ''<meta name="author" content="${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; }; };