lib/jekyll/page.rb in jekyll-1.0.0.rc1 vs lib/jekyll/page.rb in jekyll-1.0.0
- old
+ new
@@ -76,10 +76,11 @@
end
# sanitize url
@url = url.split('/').reject{ |part| part =~ /^\.+$/ }.join('/')
@url += "/" if url =~ /\/$/
+ @url.gsub!(/\A([^\/])/, '/\1')
@url
end
# Extract information from the page filename.
#
@@ -125,22 +126,9 @@
# The url needs to be unescaped in order to preserve the correct
# filename.
path = File.join(dest, CGI.unescape(self.url))
path = File.join(path, "index.html") if self.url =~ /\/$/
path
- end
-
- # Write the generated page file to the destination directory.
- #
- # dest - The String path to the destination dir.
- #
- # Returns nothing.
- def write(dest)
- path = destination(dest)
- FileUtils.mkdir_p(File.dirname(path))
- File.open(path, 'w') do |f|
- f.write(self.output)
- end
end
# Returns the object as a debug String.
def inspect
"#<Jekyll:Page @name=#{self.name.inspect}>"