forked from fediversity/fediversity
		
	make collection entries more convenient to access
This commit is contained in:
		
							parent
							
								
									2357bfe6ad
								
							
						
					
					
						commit
						4dfcec607b
					
				
					 3 changed files with 8 additions and 3 deletions
				
			
		|  | @ -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 = { | ||||
|  |  | |||
|  | @ -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); | ||||
|         }; | ||||
|       }; | ||||
|     })); | ||||
|   }; | ||||
|  |  | |||
|  | @ -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: { | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue