diff --git a/website/structure/article.nix b/website/structure/article.nix index e443dc5..fc8986e 100644 --- a/website/structure/article.nix +++ b/website/structure/article.nix @@ -25,7 +25,7 @@ in default = null; }; }; - config.name = lib.slug config.title; + config.name = with lib; mkDefault (slug config.title); config.outputs.html = lib.mkForce ((cfg.templates.html.page config).override (final: prev: { html = { diff --git a/website/structure/collections.nix b/website/structure/collections.nix index a4f4fa6..8da3380 100644 --- a/website/structure/collections.nix +++ b/website/structure/collections.nix @@ -52,12 +52,17 @@ in }; entry = mkOption { description = "An entry in the collection"; - type = types.collection (types.submodule ({ + type = with types; collection (submodule ({ imports = [ config.type ]; _module.args.collection = config; process-locations = ls: with lib; concatMap (l: map (p: "${p}/${l}") config.prefixes) ls; })); }; + by-name = mkOption { + description = "Entries accessible by symbolic name"; + type = with types; attrsOf attrs; + default = with lib; listToAttrs (map (e: { name = e.name; value = e; }) config.entry); + }; }; })); }; diff --git a/website/structure/event.nix b/website/structure/event.nix index 8cfe233..595d1b5 100644 --- a/website/structure/event.nix +++ b/website/structure/event.nix @@ -39,7 +39,7 @@ in type = with types; str; }; }; - config.name = lib.slug config.title; + config.name = with lib; mkDefault (slug config.title); config.summary = lib.mkDefault config.description; config.outputs.html = lib.mkForce ((cfg.templates.html.page config).override (final: prev: {