fix frontmatter test
This commit is contained in:
parent
ef89be163d
commit
dc231e42fb
1 changed files with 32 additions and 30 deletions
|
@ -22,6 +22,7 @@ module Middleman::CoreExtensions::FrontMatter
|
||||||
::Tilt::register HamlTemplate, 'haml'
|
::Tilt::register HamlTemplate, 'haml'
|
||||||
::Tilt.prefer(HamlTemplate)
|
::Tilt.prefer(HamlTemplate)
|
||||||
|
|
||||||
|
app.after_feature_init do
|
||||||
app.before do
|
app.before do
|
||||||
result = resolve_template(request.path_info, :raise_exceptions => false)
|
result = resolve_template(request.path_info, :raise_exceptions => false)
|
||||||
|
|
||||||
|
@ -42,6 +43,9 @@ module Middleman::CoreExtensions::FrontMatter
|
||||||
app.data_content("page", data)
|
app.data_content("page", data)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
alias :included :registered
|
||||||
|
|
||||||
def parse_front_matter(content)
|
def parse_front_matter(content)
|
||||||
yaml_regex = /^(---\s*\n.*?\n?)^(---\s*$\n?)/m
|
yaml_regex = /^(---\s*\n.*?\n?)^(---\s*$\n?)/m
|
||||||
|
@ -59,8 +63,6 @@ module Middleman::CoreExtensions::FrontMatter
|
||||||
[data, content]
|
[data, content]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
alias :included :registered
|
|
||||||
end
|
|
||||||
|
|
||||||
module ClassMethods
|
module ClassMethods
|
||||||
def parse_front_matter(content)
|
def parse_front_matter(content)
|
||||||
|
|
Loading…
Add table
Reference in a new issue