Merge pull request #977 from maul-esel/no-layout-defaults
No layout defaults (reverts #580)
This commit is contained in:
commit
9571e4c536
|
@ -31,7 +31,6 @@ module Jekyll
|
||||||
# Returns nothing.
|
# Returns nothing.
|
||||||
def read_yaml(base, name)
|
def read_yaml(base, name)
|
||||||
super(base, name)
|
super(base, name)
|
||||||
self.data['layout'] = 'page' unless self.data.has_key?('layout')
|
|
||||||
self.data
|
self.data
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,6 @@ module Jekyll
|
||||||
def read_yaml(base, name)
|
def read_yaml(base, name)
|
||||||
super(base, name)
|
super(base, name)
|
||||||
self.extracted_excerpt = self.extract_excerpt
|
self.extracted_excerpt = self.extract_excerpt
|
||||||
self.data['layout'] = 'post' unless self.data.has_key?('layout')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# The post excerpt. This is either a custom excerpt
|
# The post excerpt. This is either a custom excerpt
|
||||||
|
|
|
@ -102,16 +102,6 @@ class TestPage < Test::Unit::TestCase
|
||||||
assert_equal "/about/", @page.dir
|
assert_equal "/about/", @page.dir
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with unspecified layout" do
|
|
||||||
setup do
|
|
||||||
@page = setup_page('contacts.html')
|
|
||||||
end
|
|
||||||
|
|
||||||
should "default to 'post' layout" do
|
|
||||||
assert_equal "page", @page.data["layout"]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context "with specified layout of nil" do
|
context "with specified layout of nil" do
|
||||||
setup do
|
setup do
|
||||||
|
|
|
@ -95,7 +95,7 @@ class TestPost < Test::Unit::TestCase
|
||||||
should "consume the embedded dashes" do
|
should "consume the embedded dashes" do
|
||||||
@post.read_yaml(@source, @real_file)
|
@post.read_yaml(@source, @real_file)
|
||||||
|
|
||||||
assert_equal({"title" => "Foo --- Bar", "layout" => "post"}, @post.data)
|
assert_equal({"title" => "Foo --- Bar"}, @post.data)
|
||||||
assert_equal "Triple the fun!", @post.content
|
assert_equal "Triple the fun!", @post.content
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -139,18 +139,6 @@ class TestPost < Test::Unit::TestCase
|
||||||
assert_equal "/2013/2008/09/09/foo-bar.html", @post.url
|
assert_equal "/2013/2008/09/09/foo-bar.html", @post.url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with unspecified layout" do
|
|
||||||
setup do
|
|
||||||
file = '2013-01-12-no-layout.textile'
|
|
||||||
@post = setup_post(file)
|
|
||||||
@post.process(file)
|
|
||||||
end
|
|
||||||
|
|
||||||
should "default to 'post' layout" do
|
|
||||||
assert_equal "post", @post.data["layout"]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context "with specified layout of nil" do
|
context "with specified layout of nil" do
|
||||||
setup do
|
setup do
|
||||||
|
|
Loading…
Reference in New Issue