Remove yet another way to register extensions and register/activate FrontMatter like a normal extension.

This commit is contained in:
Ben Hollis 2014-03-29 17:17:00 -07:00
parent a6c37f3dd3
commit abeee38126
4 changed files with 8 additions and 19 deletions

View file

@ -142,10 +142,6 @@ module Middleman
# Setup custom rendering # Setup custom rendering
include Middleman::CoreExtensions::Rendering include Middleman::CoreExtensions::Rendering
# Parse YAML from templates. Must be before sitemap so sitemap
# extensions see updated frontmatter!
register Middleman::CoreExtensions::FrontMatter
# Sitemap Config options and public api # Sitemap Config options and public api
include Middleman::Sitemap include Middleman::Sitemap
@ -182,6 +178,10 @@ module Middleman
# Setup the default values from calls to set before initialization # Setup the default values from calls to set before initialization
self.class.config.load_settings(self.class.superclass.config.all_settings) self.class.config.load_settings(self.class.superclass.config.all_settings)
# Parse YAML from templates. Must be before sitemap so sitemap
# extensions see updated frontmatter!
activate :front_matter
# Initialize the Sitemap # Initialize the Sitemap
@sitemap = ::Middleman::Sitemap::Store.new(self) @sitemap = ::Middleman::Sitemap::Store.new(self)

View file

@ -12,7 +12,10 @@ require 'middleman-core/core_extensions/extensions'
require 'middleman-core/core_extensions/data' require 'middleman-core/core_extensions/data'
# Parse YAML from templates # Parse YAML from templates
Middleman::Extensions.register :front_matter do
require 'middleman-core/core_extensions/front_matter' require 'middleman-core/core_extensions/front_matter'
Middleman::CoreExtensions::FrontMatter
end
# External helpers looks in the helpers/ folder for helper modules # External helpers looks in the helpers/ folder for helper modules
require 'middleman-core/core_extensions/external_helpers' require 'middleman-core/core_extensions/external_helpers'

View file

@ -62,19 +62,6 @@ module Middleman
def configure(env, &block) def configure(env, &block)
send("#{env}_config", &block) send("#{env}_config", &block)
end end
# Register a new extension
#
# @param [Module] extension Extension modules to register
# @param [Hash] options Per-extension options hash
# @return [void]
def register(extension, options={}, &block)
if extension.ancestors.include?(::Middleman::Extension)
extension.new(self, options, &block)
else
$stderr.puts "!! Tried to register old-style extension: #{extension}"
end
end
end end
# Instance methods # Instance methods

View file

@ -1,6 +1,5 @@
# Core Sitemap Extensions # Core Sitemap Extensions
module Middleman module Middleman
module Sitemap module Sitemap
# Setup Extension # Setup Extension