1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00

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
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
include Middleman::Sitemap
@ -182,6 +178,10 @@ module Middleman
# Setup the default values from calls to set before initialization
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
@sitemap = ::Middleman::Sitemap::Store.new(self)

View file

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

View file

@ -62,19 +62,6 @@ module Middleman
def configure(env, &block)
send("#{env}_config", &block)
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
# Instance methods

View file

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