Still.Image.TemplateHelpers (Still v0.8.0) View Source

Generates a set of images to ensure they are responsive.

See Still.Image.Preprocessor for details on these transformations.

Link to this section Summary

Functions

Returns a list of Elixir.Still.Image.Preprocessor.SourceFile for the given input file.

Checks if a file is a supported image.

Returns an image tag with the src and srcset.

Returns the file to be usd in a image's src attribute.

Returns the file to be usd in a image's srcset attribute.

Link to this section Functions

Link to this function

get_output_files(file, opts \\ [])

View Source

Specs

get_output_files(file :: String.t(), list()) :: [Still.SourceFile.t()]

Returns a list of Elixir.Still.Image.Preprocessor.SourceFile for the given input file.

If :sizes or :transformations are present in opts, they will be passed to Still.Image.Preprocessor.

If :sizes is not set, the default will be 25%, 50%, 75% and 100% of the input file's width.

Specs

is_img?(String.t()) :: boolean()

Checks if a file is a supported image.

Link to this function

render_html(file, opts \\ [])

View Source

Specs

render_html(file :: String.t(), list()) :: String.t()

Returns an image tag with the src and srcset.

If :sizes or :transformations are present in opts, they will be passed to Still.Image.Preprocessor.

If :sizes is not set, the default will be 25%, 50%, 75% and 100% of the input file's width.

Link to this function

render_src(output_files)

View Source

Specs

render_src([Still.SourceFile.t()]) :: String.t()

Returns the file to be usd in a image's src attribute.

Link to this function

render_srcset(output_files)

View Source

Specs

render_srcset([Still.SourceFile.t()]) :: String.t()

Returns the file to be usd in a image's srcset attribute.