Reorder extensions so frontmatter is available before sitemap

This commit is contained in:
Ben Hollis 2012-04-20 23:38:59 -07:00
parent 9be76da3cf
commit 0a677f5de1
3 changed files with 11 additions and 10 deletions

View file

@ -225,6 +225,9 @@ module Middleman
# Activate Data package
register Middleman::CoreExtensions::Data
# Parse YAML from templates
register Middleman::CoreExtensions::FrontMatter
# Setup custom rendering
register Middleman::CoreExtensions::Rendering
@ -243,9 +246,6 @@ module Middleman
# with_layout and page routing
register Middleman::CoreExtensions::Routing
# Parse YAML from templates
register Middleman::CoreExtensions::FrontMatter
# i18n
register Middleman::CoreExtensions::I18n

View file

@ -50,8 +50,6 @@ module Middleman::CoreExtensions::FrontMatter
# Override init
def initialize
super
exts = frontmatter_extensions.join("|").gsub(".", "\.")
static_path = source_dir.sub(root, "").sub(/^\//, "").sub(/\/$/, "") + "/"
@ -85,6 +83,8 @@ module Middleman::CoreExtensions::FrontMatter
# Initialize class
frontmatter_extension
super
end
# Notify callbacks that the frontmatter changed
@ -153,6 +153,7 @@ module Middleman::CoreExtensions::FrontMatter
if result
data, content = result
data = ::Middleman::Util.recursively_enhance(data).freeze
file = file.sub(@app.source_dir, "")
@local_data[file] = [data, content]

View file

@ -40,8 +40,6 @@ module Middleman::CoreExtensions::Rendering
}
super
static_path = source_dir.sub(self.root, "").sub(/^\//, "")
render_regex = static_path.empty? ? // : (%r{^#{static_path + "/"}})
@ -49,6 +47,8 @@ module Middleman::CoreExtensions::Rendering
path = File.expand_path(file, self.root)
self.cache.remove(:raw_template, path)
end
super
end
# Add or overwrite a default template extension