mirror of
https://github.com/tnypxl/rollup.git
synced 2025-12-15 15:03:17 +00:00
fix: resolve type mismatch for PathOverrides in SiteConfig
This commit is contained in:
14
cmd/web.go
14
cmd/web.go
@@ -52,7 +52,7 @@ func runWeb(cmd *cobra.Command, args []string) error {
|
|||||||
AllowedPaths: site.AllowedPaths,
|
AllowedPaths: site.AllowedPaths,
|
||||||
ExcludePaths: site.ExcludePaths,
|
ExcludePaths: site.ExcludePaths,
|
||||||
OutputAlias: site.OutputAlias,
|
OutputAlias: site.OutputAlias,
|
||||||
PathOverrides: site.PathOverrides,
|
PathOverrides: convertPathOverrides(site.PathOverrides),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -227,3 +227,15 @@ func sanitizeFilename(name string) string {
|
|||||||
|
|
||||||
return name
|
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
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user