Merge commit '7655c745c46559d7598b5558fc9bf6fa8b215e28'
This commit is contained in:
commit
fa1043ca69
|
@ -83,7 +83,8 @@ module Jekyll
|
||||||
permalink.to_s.split("/")[0..-2].join("/") + '/'
|
permalink.to_s.split("/")[0..-2].join("/") + '/'
|
||||||
else
|
else
|
||||||
prefix = self.categories.empty? ? '' : '/' + self.categories.join('/')
|
prefix = self.categories.empty? ? '' : '/' + self.categories.join('/')
|
||||||
if Jekyll.permalink_style == :date
|
if Jekyll.permalink_style == :date ||
|
||||||
|
Jekyll.permalink_style == :pretty
|
||||||
prefix + date.strftime("/%Y/%m/%d/")
|
prefix + date.strftime("/%Y/%m/%d/")
|
||||||
else
|
else
|
||||||
prefix + '/'
|
prefix + '/'
|
||||||
|
@ -105,7 +106,8 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns <String>
|
# Returns <String>
|
||||||
def url
|
def url
|
||||||
permalink || self.dir + self.slug + ".html"
|
permalink || self.id +
|
||||||
|
( ".html" unless Jekyll.permalink_style == :pretty ).to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
# The UID for this post (useful in feeds)
|
# The UID for this post (useful in feeds)
|
||||||
|
@ -163,6 +165,12 @@ module Jekyll
|
||||||
FileUtils.mkdir_p(File.join(dest, dir))
|
FileUtils.mkdir_p(File.join(dest, dir))
|
||||||
|
|
||||||
path = File.join(dest, self.url)
|
path = File.join(dest, self.url)
|
||||||
|
|
||||||
|
if Jekyll.permalink_style == :pretty
|
||||||
|
FileUtils.mkdir_p(path)
|
||||||
|
path = File.join(path, "index.html")
|
||||||
|
end
|
||||||
|
|
||||||
File.open(path, 'w') do |f|
|
File.open(path, 'w') do |f|
|
||||||
f.write(self.output)
|
f.write(self.output)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue