docs: avoid duplicate maintainers

This commit is contained in:
Gaetan Lepage 2024-03-08 08:37:45 +01:00 committed by Gaétan Lepage
parent 45dec97e80
commit cd32dcd50f

View file

@ -65,10 +65,10 @@ with lib; let
if builtins.length path >= 2 && lib.hasAttrByPath path nixvimInfo if builtins.length path >= 2 && lib.hasAttrByPath path nixvimInfo
then let then let
info = lib.getAttrFromPath path nixvimInfo; info = lib.getAttrFromPath path nixvimInfo;
maintainers = options.config.meta.maintainers."${info.file}" or null; maintainers = lib.unique (options.config.meta.maintainers."${info.file}" or []);
in in
"# ${lib.last path}\n\n" "# ${lib.last path}\n\n"
+ (lib.optionalString (maintainers != null && builtins.length maintainers > 0) + (lib.optionalString (builtins.length maintainers > 0)
"Maintainers: ${lib.concatStringsSep ", " (builtins.map (m: m.name) maintainers)}\n\n") "Maintainers: ${lib.concatStringsSep ", " (builtins.map (m: m.name) maintainers)}\n\n")
+ (lib.optionalString (info.url != null) "Url: [${info.url}](${info.url})\n\n") + (lib.optionalString (info.url != null) "Url: [${info.url}](${info.url})\n\n")
else null; else null;