Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit ece127c86531977c236ce526dba079a8a3a4aff0 1 parent 96bf21d
@JackDanger JackDanger authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  lib/jekyll/site.rb
View
2  lib/jekyll/site.rb
@@ -92,10 +92,12 @@ def transform_pages(dir = '')
else
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 == "---"
page = Page.new(self.source, dir, f)
page.add_layout(self.layouts, site_payload)
page.write(self.dest)
+ # otherwise copy the file without transforming it
else
FileUtils.mkdir_p(File.join(self.dest, dir))
FileUtils.cp(File.join(self.source, dir, f), File.join(self.dest, dir, f))
Please sign in to comment.
Something went wrong with that request. Please try again.