forked from Fediversity/Fediversity
make collection entries more convenient to access
This commit is contained in:
parent
2357bfe6ad
commit
4dfcec607b
|
@ -25,7 +25,7 @@ in
|
||||||
default = null;
|
default = null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config.name = lib.slug config.title;
|
config.name = with lib; mkDefault (slug config.title);
|
||||||
config.outputs.html = lib.mkForce
|
config.outputs.html = lib.mkForce
|
||||||
((cfg.templates.html.page config).override (final: prev: {
|
((cfg.templates.html.page config).override (final: prev: {
|
||||||
html = {
|
html = {
|
||||||
|
|
|
@ -52,12 +52,17 @@ in
|
||||||
};
|
};
|
||||||
entry = mkOption {
|
entry = mkOption {
|
||||||
description = "An entry in the collection";
|
description = "An entry in the collection";
|
||||||
type = types.collection (types.submodule ({
|
type = with types; collection (submodule ({
|
||||||
imports = [ config.type ];
|
imports = [ config.type ];
|
||||||
_module.args.collection = config;
|
_module.args.collection = config;
|
||||||
process-locations = ls: with lib; concatMap (l: map (p: "${p}/${l}") config.prefixes) ls;
|
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);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
|
@ -39,7 +39,7 @@ in
|
||||||
type = with types; str;
|
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.summary = lib.mkDefault config.description;
|
||||||
config.outputs.html = lib.mkForce
|
config.outputs.html = lib.mkForce
|
||||||
((cfg.templates.html.page config).override (final: prev: {
|
((cfg.templates.html.page config).override (final: prev: {
|
||||||
|
|
Loading…
Reference in a new issue