module
Amber::Controller::Helpers::AssetHelpers
Direct including types
Defined in:
amber/controller/helpers/asset_helpers.crInstance Method Summary
-
#asset_integrity(path : String) : String
Returns the Subresource Integrity value recorded for a logical asset.
-
#asset_path(path : String) : String
Resolves a logical, build-authored asset name through the persisted manifest.
-
#favicon_tag(path : String = "/favicon.ico") : String
Generates a favicon link tag.
-
#image_tag(src : String, **attrs) : String
Generates an image tag.
-
#javascript_importmap_tag(imports : Hash(String, String), preload : Array(String) = [] of String) : String
Generates a safe inline import map and optional local module preloads.
-
#javascript_include_tag(path : String, **attrs) : String
Generates a script tag for including JavaScript.
-
#stylesheet_link_tag(path : String, **attrs) : String
Generates a stylesheet link tag.
Instance Method Detail
Returns the Subresource Integrity value recorded for a logical asset.
Resolves a logical, build-authored asset name through the persisted manifest. Already-public URLs remain unchanged for backwards compatibility.
Generates a favicon link tag.
favicon_tag # => "<link rel=\"icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />"
favicon_tag("/images/icon.png") # => "<link rel=\"icon\" type=\"image/x-icon\" href=\"/images/icon.png\" />"
Generates an image tag.
image_tag("images/logo.png") # resolves through the asset manifest
image_tag("images/logo.png", alt: "Logo")
image_tag("images/photo.jpg", width: "200", height: "100")
Generates a safe inline import map and optional local module preloads. Local values are resolved through the same asset manifest as other tags.
Generates a script tag for including JavaScript.
javascript_include_tag("javascript/app.js")
# Resolves the fingerprinted URL and adds its integrity value.
Generates a stylesheet link tag.
stylesheet_link_tag("stylesheets/app.css")
# Resolves the fingerprinted URL and adds its integrity value.