Skip to content

AssetSpec

ts
type AssetSpec = object;

Defined in: server/asset.ts:37 ↗

Per-asset specifications assigned by the user.

Properties

class?

ts
optional class: string;

Defined in: server/asset.ts:57 ↗

When specified, adds specified class attribute to generated HTML container.


eager?

ts
optional eager: boolean;

Defined in: server/asset.ts:43 ↗

When set to true the asset will be loaded eagerly (instead of default lazy). Use for above the fold content, ie initially visible w/o scrolling, such as hero image.


media?

ts
optional media: string;

Defined in: server/asset.ts:55 ↗

Media attribute to specify for applicable source tag. Can be used with the "merge" spec for art direction. Example below will show "wide.png" when window width is 800px or more and switch to "narrow.png" when the window width is equal to or below 799px.

Example

md
 ![?media=(min-width:800px)](/wide.png)
 ![?media=(max-width:799px)&merge](/narrow.png)

merge?

ts
optional merge: boolean;

Defined in: server/asset.ts:46 ↗

When set to true syntax will be merged with the previous one in the document. Can be used to specify multiple sources with different specs for a single asset.


width?

ts
optional width: number;

Defined in: server/asset.ts:40 ↗

Width threshold for the asset content, in pixels. Overrides global width parameter.