diff --git a/README.md b/README.md index 717823ba..61866dc9 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ The best way to get quick responses to your issues and swift fixes to your bugs # Build & Dependency Status -[![Build Status](https://secure.travis-ci.org/middleman/middleman.png?branch=master)](http://travis-ci.org/middleman/middleman) +[![Build Status](https://travis-ci.org/middleman/middleman.png)](https://travis-ci.org/middleman/middleman) [![Dependency Status](https://gemnasium.com/middleman/middleman.png?travis)](https://gemnasium.com/middleman/middleman) # How to Run Cucumber Tests @@ -83,7 +83,7 @@ The best way to get quick responses to your issues and swift fixes to your bugs # Donate -Please, [help support the Middleman team with a donation](https://spb.io/s/4dXbHBorC3). +[Click here to lend your support to Middleman](https://spacebox.io/s/4dXbHBorC3) # License diff --git a/middleman-core/lib/middleman-core/core_extensions/front_matter.rb b/middleman-core/lib/middleman-core/core_extensions/front_matter.rb index 7460dca9..3d7a5b49 100644 --- a/middleman-core/lib/middleman-core/core_extensions/front_matter.rb +++ b/middleman-core/lib/middleman-core/core_extensions/front_matter.rb @@ -72,8 +72,9 @@ module Middleman::CoreExtensions @cache.delete(path) end - YAML_ERRORS = [ Exception, ArgumentError ] + YAML_ERRORS = [ StandardError ] + # https://github.com/tenderlove/psych/issues/23 if defined?(Psych) && defined?(Psych::SyntaxError) YAML_ERRORS << Psych::SyntaxError end diff --git a/middleman-core/lib/middleman-core/core_extensions/rendering.rb b/middleman-core/lib/middleman-core/core_extensions/rendering.rb index 4dea060a..7962afe2 100644 --- a/middleman-core/lib/middleman-core/core_extensions/rendering.rb +++ b/middleman-core/lib/middleman-core/core_extensions/rendering.rb @@ -19,6 +19,9 @@ module Middleman # Include methods app.send :include, InstanceMethods + app.define_hook :before_render + app.define_hook :after_render + # Activate custom renderers require "middleman-core/renderers/erb" app.register Middleman::Renderers::ERb @@ -249,7 +252,10 @@ module Middleman end # Render using Tilt - template.render(context, locs, &block) + run_hook :before_render, template.data, template + content = template.render(context, locs, &block) + run_hook :after_render, content, template + return content ensure # Reset stored buffer @_out_buf = _buf_was