feat: Implement syntactic sugar and site-specific discovery config
- Add syntactic sugar for container transformation: .insertr containers → children get .insertr - Fix discovery auto-running when disabled with site-specific config loading - Add comprehensive styling test examples for HTML attribute preservation - Include test input for syntactic sugar validation - Update discovery defaults to respect developer intent (disabled by default)
This commit is contained in:
20
cmd/serve.go
20
cmd/serve.go
@@ -138,6 +138,26 @@ func runServe(cmd *cobra.Command, args []string) {
|
||||
if autoEnhance, ok := configMap["auto_enhance"].(bool); ok {
|
||||
site.AutoEnhance = autoEnhance
|
||||
}
|
||||
// Parse discovery config if present
|
||||
if discoveryMap, ok := configMap["discovery"].(map[string]interface{}); ok {
|
||||
discovery := &content.DiscoveryConfig{
|
||||
Containers: true, // defaults
|
||||
Individual: true,
|
||||
}
|
||||
if enabled, ok := discoveryMap["enabled"].(bool); ok {
|
||||
discovery.Enabled = enabled
|
||||
}
|
||||
if aggressive, ok := discoveryMap["aggressive"].(bool); ok {
|
||||
discovery.Aggressive = aggressive
|
||||
}
|
||||
if containers, ok := discoveryMap["containers"].(bool); ok {
|
||||
discovery.Containers = containers
|
||||
}
|
||||
if individual, ok := discoveryMap["individual"].(bool); ok {
|
||||
discovery.Individual = individual
|
||||
}
|
||||
site.Discovery = discovery
|
||||
}
|
||||
if site.SiteID != "" && site.Path != "" {
|
||||
sites = append(sites, site)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user