Layouts default to page or post depending upon type.
This commit is contained in:
parent
d9bc6b57d5
commit
e8c74fe7a8
|
@ -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 '/'
|
||||
|
|
|
@ -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.
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue