#config[:build_dir]=(value) ⇒ String

Note:

This is a Middleman application level config option.

Indicates where Middleman will put build output. This standard config value will be treated as a prefix; for example if the current target is :pro and this value is set to its default build, then the actual build directory will be build (pro)/.

If the build_dir key is present for any of the config[:targets], they will override this setting.

Parameters:

  • value (String)

    Indicate the build directory prefix that should be used for build output.

Returns:

  • (String)

    Returns the current value of this configuration setting.

#config[:target]=(value) ⇒ Symbol

Note:

This is a Middleman application level config option.

Indicates the current target that is being built or served. When set in config.rb it indicates the default target if one is not specified on the command line.

Parameters:

  • value (Symbol)

    The target from config[:targets] that should be used as the default.

Returns:

  • (Symbol)

    Returns the current target.

#config[:target_magic_images]=(value) ⇒ Boolean

Note:

This is a Middleman application level config option.

This option is used to enable or disable the target magic images feature. If it’s true then the image_tag helper will attempt to substitute target-specific images instead of the specified image, if the specified image begins with :target_magic_word.

Parameters:

  • value (Boolean)

    Specify whether or not automatic target-specific image substitution should be enabled.

Returns:

  • (Boolean)

    Returns the current state of this option.

#config[:target_magic_word]=(value) ⇒ String

Note:

This is a Middleman application level config option.

Indicates the magic image prefix for image substitution with the image_tag helper when :target_magic_images is enabled. For example if you specify all-image.png and pro-image.png exists, then the latter will be used by the helper instead of the former.

Parameters:

  • value (String)

    Indicate the prefix that should indicate and image the should be substituted, such as all.

Returns:

  • (String)

    Returns the current magic prefix.

#config[:targets]=(value) ⇒ Hash

Note:

This is a Middleman application level config option.

A hash that defines all of the characteristics of your individual targets. The build_dir and features keys in a target have special meanings; other keys can be added arbitrarily and helpers can fetch these for you. A best practice is to assign the same features to all of your targets and toggle them on or off on a target-specific basis.

Examples:

You might define this in your config.rb like this:

config[:targets] = {
  :free =>
      {
          :sample_key => 'People who use free versions don\'t drive profits.',
          :build_dir  => 'build (%s)',
          :features   =>
              {
                  :feature_advertise_pro => true,
                  :insults_user          => true,
                  :grants_wishes         => false,
              }
      },

      :pro =>
      {
          :sample_key => 'You are a valued contributor to our balance sheet!',
          :features =>
              {
                  :feature_advertise_pro => false,
                  :insults_user          => false,
                  :grants_wishes         => true,
              }
      },
  }

Parameters:

  • value (Hash)

    The complete definition of your targets, their features, and other keys-value pairs that you wish to include.

Returns:

  • (Hash)

    Returns the attributes of your targets.