mirror of
https://github.com/tnypxl/rollup.git
synced 2025-12-13 06:23:18 +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,
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user