Function
asset
From mothwing ยท src/asset.js:39
A file for the build, made from data: a search index, a feed, a generated image. The build writes it, and a page links to it by this value, its URL with a hash of the content, like the JS and CSS links: <input data-index="{{ search.index }}"> -> data-index="/search.json?v=1a2b3c4d". The hash only changes when the content does, so browsers and CDNs can keep it until then.
asset(
file: string,
content: string | Uint8Array<ArrayBufferLike>
): AssetParameters
file | string | Where it goes in the build: "search.json" |
|---|---|---|
content | string | Uint8Array<ArrayBufferLike> |