Module:LuaTemplateBlueprint: Difference between revisions

// via Wikitext Extension for VSCode
// via Wikitext Extension for VSCode
Tag: Reverted
Line 358: Line 358:
     local templateType = template.type
     local templateType = template.type
     local configOverrides = template.config or {}
     local configOverrides = template.config or {}
   
 
     -- Get base configuration from repository
     -- Get base configuration from repository
     local baseConfig = ConfigRepository.getStandardConfig(templateType)
     local baseConfig = ConfigRepository.getStandardConfig(templateType)
   
 
     -- Apply overrides to each section
     -- Use TemplateHelpers to deep merge configurations
     local config = {}
     local config = TemplateHelpers.deepMerge(baseConfig, configOverrides)
    for _, section in ipairs(p.configSections) do
 
        config[section] = config[section] or {}
       
        -- Copy base config for this section if available
        if baseConfig[section] then
            for k, v in pairs(baseConfig[section]) do
                config[section][k] = v
            end
        end
       
        -- Apply overrides for this section if available
        if configOverrides[section] then
            for k, v in pairs(configOverrides[section]) do
                config[section][k] = v
            end
        end
    end
   
     -- Store complete config in template
     -- Store complete config in template
     template.config = config
     template.config = config
Line 395: Line 378:
         end)
         end)
     end
     end
   
 
     return config
     return config
end
end