Settings management for multi environments in config files for middleman http://middlemanapp.com
middleman-settings
is an extension for the Middleman static site generator that allows you manage your config variables from a config file
If you’re just getting started, install the middleman
gem and generate a new project:
gem install middleman
middleman init MY_PROJECT
If you already have a Middleman project: Add gem "middleman-settings"
to your Gemfile
and run bundle install
.
activate :settings #this will load the config files from the config folder from your root app
exemple of config file:
build:
api_key: <% ENV['FOO_API_KEY'] %>
development:
api_key: "foobar"
You can also change the defaule directory:
activate :settings, :config_folder => 'my_super_config_folder'
The extension adds a new code
helper to Middleman that you can use from your templates:
<% middleman_settings['facebook']['client_token'] %>
You can also use it directly from config.rb
middleman_settings['new_relic']['api_key']
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)