Adding some comments to transform_pages to explain what's going on

This commit is contained in:
Jack Danger Canty 2008-12-10 13:37:14 -08:00
parent 96bf21dce7
commit ece127c865
1 changed files with 2 additions and 0 deletions

View File

@ -92,10 +92,12 @@ module Jekyll
else else
first3 = File.open(File.join(self.source, dir, f)) { |fd| fd.read(3) } first3 = File.open(File.join(self.source, dir, f)) { |fd| fd.read(3) }
# if the file appears to have a YAML header then process it as a page
if first3 == "---" if first3 == "---"
page = Page.new(self.source, dir, f) page = Page.new(self.source, dir, f)
page.add_layout(self.layouts, site_payload) page.add_layout(self.layouts, site_payload)
page.write(self.dest) page.write(self.dest)
# otherwise copy the file without transforming it
else else
FileUtils.mkdir_p(File.join(self.dest, dir)) FileUtils.mkdir_p(File.join(self.dest, dir))
FileUtils.cp(File.join(self.source, dir, f), File.join(self.dest, dir, f)) FileUtils.cp(File.join(self.source, dir, f), File.join(self.dest, dir, f))