Method: Hyde::Page#write

Defined in:
lib/hyde/page.rb

#write(out = nil) ⇒ Object

Writes to the given output file.



234
235
236
237
238
239
240
241
242
243
# File 'lib/hyde/page.rb', line 234

def write(out=nil)
  out ||= project.path(:output, path)
  FileUtils.mkdir_p File.dirname(out)

  if tilt?
    File.open(out, 'w') { |f| f.write to_html({}, :build => true) }
  else
    FileUtils.cp file, out
  end
end