- (Void) image_tag(path, params = {})

Override the built-in image-tag helper in order to support additional features.

  • Automatic target-specific images. Note that this only works on local files, and only if enabled with the option :target_magic_images.
  • Target and feature dependent images using the params hash.
  • Absolute paths, which Middleman sometimes bungles.

Note that in addition to the options described below, middleman-targets inherits all of the built-in option parameters as well.

Parameters:

  • path (String)

    The path to the image file.

  • params (Hash) (defaults to: {})

    Optional parameters to pass to the helper.

Options Hash (params):

  • :target (String, Symbol)

    This image tag will only be applied if the current target is target.

  • :feature (String, Symbol)

    This image tag will only be applied if the current target enables the feature feature.

Returns:

  • (Void)

- (Boolean) target_feature?(feature)

Does the target have the feature feature enabled?

Parameters:

  • feature (String, Symbol)

    Specifies a proposed feature.

Returns:

  • (Boolean)

    Returns true if the current target has the features feature and the features is enabled.

- (Symbol) target_name

Return the current build target.

Returns:

  • (Symbol)

    Returns the current build target.

- (Boolean) target_name?(proposal)

Is the current target proposal?

Parameters:

  • proposal (String, Symbol)

    Specifies a proposed target.

Returns:

  • (Boolean)

    Returns true if the current target matches the parameter proposal.

- (String, Nil) target_value(key)

Attempts to return arbitrary key values for the key key for the current target.

Parameters:

  • key (String, Symbol)

    Specifies the desired key to look up.

Returns:

  • (String, Nil)

    Returns the value for key in the :targets structure, or nil if it doesn’t exist.