Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RewriteAssetURLs ¶
RewriteAssetURLs replaces original asset URLs in HTML with local /assets/ paths. Assets that were not successfully downloaded keep their original URLs.
func RewriteCSSURLs ¶
RewriteCSSURLs replaces original url()/import references in CSS with local /assets/ paths. Only rewrites assets that were successfully downloaded.
Types ¶
type Asset ¶
type Asset struct {
OriginalURL string
AbsoluteURL string
LocalPath string // filename under assets/
Tag string
Attr string
Downloaded bool
}
Asset represents a discovered external resource in the cloned page.
type CSSAsset ¶
type CSSAsset struct {
OriginalRef string // the full matched token, e.g. `url("foo.png")`
RawURL string // the URL string within the token
AbsoluteURL string
LocalPath string
Downloaded bool
}
CSSAsset represents a resource discovered inside a CSS file.
Click to show internal directories.
Click to hide internal directories.