a few style changes and readme for pretty permalink

This commit is contained in:
Tom Preston-Werner
2009-03-10 16:30:14 -07:00
parent fa1043ca69
commit 86e72a8b25
2 changed files with 26 additions and 9 deletions

View File

@@ -83,8 +83,7 @@ module Jekyll
permalink.to_s.split("/")[0..-2].join("/") + '/'
else
prefix = self.categories.empty? ? '' : '/' + self.categories.join('/')
if Jekyll.permalink_style == :date ||
Jekyll.permalink_style == :pretty
if [:date, :pretty].include?(Jekyll.permalink_style)
prefix + date.strftime("/%Y/%m/%d/")
else
prefix + '/'
@@ -106,8 +105,8 @@ module Jekyll
#
# Returns <String>
def url
permalink || self.id +
( ".html" unless Jekyll.permalink_style == :pretty ).to_s
ext = Jekyll.permalink_style == :pretty ? '' : '.html'
permalink || self.id + ext
end
# The UID for this post (useful in feeds)
@@ -117,7 +116,7 @@ module Jekyll
def id
self.dir + self.slug
end
# Calculate related posts.
#
# Returns [<Post>]