Layouts default to page or post depending upon type.

This commit is contained in:
7rans 2013-01-12 13:48:44 -08:00 committed by Parker Moore
parent d9bc6b57d5
commit e8c74fe7a8
2 changed files with 24 additions and 0 deletions

View File

@ -24,6 +24,18 @@ module Jekyll
self.read_yaml(File.join(base, dir), name)
end
# Read the YAML frontmatter.
#
# base - The String path to the dir containing the file.
# name - The String filename of the file.
#
# Returns nothing.
def read_yaml(base, name)
super(base, name)
self.data['layout'] ||= 'page'
self.data
end
# The generated directory into which the page will be placed
# upon generation. This is derived from the permalink or, if
# permalink is absent, we be '/'

View File

@ -66,6 +66,18 @@ module Jekyll
end
end
# Read the YAML frontmatter.
#
# base - The String path to the dir containing the file.
# name - The String filename of the file.
#
# Returns nothing.
def read_yaml(base, name)
super(base, name)
self.data['layout'] ||= 'post'
self.data
end
# Compares Post objects. First compares the Post date. If the dates are
# equal, it compares the Post slugs.
#