From cdcd2bd42d37fe69df7c9953eb47f39df585bfb7 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Tue, 26 Apr 2016 09:24:49 -0700 Subject: [PATCH] Expose development? and production? helpers to template context. Related #1895 --- CHANGELOG.md | 4 ++++ middleman-core/lib/middleman-core/template_context.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 814ca03b..826135e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ master === +# Next + +* Expose `development?` and `production?` helpers to template context. + # 4.1.8 * Let collection loops access ConfigContext for helpers. #1879 diff --git a/middleman-core/lib/middleman-core/template_context.rb b/middleman-core/lib/middleman-core/template_context.rb index ca5f3632..0842b846 100644 --- a/middleman-core/lib/middleman-core/template_context.rb +++ b/middleman-core/lib/middleman-core/template_context.rb @@ -23,7 +23,7 @@ module Middleman attr_accessor :current_engine # Shorthand references to global values on the app instance. - def_delegators :@app, :config, :logger, :sitemap, :server?, :build?, :environment?, :environment, :data, :extensions, :root + def_delegators :@app, :config, :logger, :sitemap, :server?, :build?, :environment?, :environment, :data, :extensions, :root, :development?, :production? # Initialize a context with the current app and predefined locals and options hashes. #