# File lib/jekyll/page.rb, line 102 def write(dest_prefix, dest_suffix = nil) dest = File.join(dest_prefix, @dir) dest = File.join(dest, dest_suffix) if dest_suffix FileUtils.mkdir_p(dest) # The url needs to be unescaped in order to preserve the correct filename path = File.join(dest, CGI.unescape(self.url)) if self.url =~ /\/$/ FileUtils.mkdir_p(path) path = File.join(path, "index.html") end File.open(path, 'w') do |f| f.write(self.output) end end