diff --git a/lib/jekyll/page.rb b/lib/jekyll/page.rb index 82b82048..d3461181 100644 --- a/lib/jekyll/page.rb +++ b/lib/jekyll/page.rb @@ -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 '/' diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index a360cb8d..6156b5be 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -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. #