lib/plate/asset.rb in plate-0.5.2 vs lib/plate/asset.rb in plate-0.5.3

- old
+ new

@@ -16,17 +16,21 @@ def file_path "#{directory}/#{file_name}" end + def pathname + File.dirname(self.file) + end + # Same as page, but no layout applied def rendered_content return @rendered_content if @rendered_content result = File.read(file) - self.engines.each do |engine| + self.engines.each do |engine| template = engine.new() { result } result = template.render(self, :site => self.site) end @rendered_content = result @@ -34,12 +38,11 @@ # Write this page to the destination. For static files this just results # in copying the file over to the destination def write! path = File.join(site.build_destination, file_path) - FileUtils.mkdir_p(File.dirname(path)) - + File.open(path, 'w') do |f| f.write(self.rendered_content) end end end \ No newline at end of file