fix: resolve type mismatch for PathOverrides in SiteConfig

This commit is contained in:
Arik Jones (aider)
2024-09-19 16:11:14 -05:00
parent e3fddf101c
commit 1d02cab585

View File

@@ -52,7 +52,7 @@ func runWeb(cmd *cobra.Command, args []string) error {
AllowedPaths: site.AllowedPaths,
ExcludePaths: site.ExcludePaths,
OutputAlias: site.OutputAlias,
PathOverrides: site.PathOverrides,
PathOverrides: convertPathOverrides(site.PathOverrides),
}
}
} else {
@@ -227,3 +227,15 @@ func sanitizeFilename(name string) string {
return name
}
func convertPathOverrides(configOverrides []config.PathOverride) []scraper.PathOverride {
scraperOverrides := make([]scraper.PathOverride, len(configOverrides))
for i, override := range configOverrides {
scraperOverrides[i] = scraper.PathOverride{
Path: override.Path,
CSSLocator: override.CSSLocator,
ExcludeSelectors: override.ExcludeSelectors,
}
}
return scraperOverrides
}