lib/awestruct/front_matter_file.rb in awestruct-0.1.3 vs lib/awestruct/front_matter_file.rb in awestruct-0.1.4

- old
+ new

@@ -2,10 +2,11 @@ module Awestruct class FrontMatterFile < RenderableFile attr_reader :raw_page_content + attr_reader :front_matter def initialize(site, source_path, relative_source_path) super( site, source_path, relative_source_path ) @raw_page_content = '' load_page @@ -38,11 +39,11 @@ @raw_page_content = yaml_content yaml_content = '' end begin - front_matter = YAML.load( yaml_content ) || {} - front_matter.each do |k,v| + @front_matter = YAML.load( yaml_content ) || {} + @front_matter.each do |k,v| self.send( "#{k}=", v ) end rescue=>e puts "error reading #{self}: #{e}" end