Applying a more 'Ruby' style to post_url.rb

This commit is contained in:
Parker Moore 2013-03-04 03:20:59 +01:00
parent 800bd290ec
commit 5af8e1f40c
1 changed files with 6 additions and 2 deletions

View File

@ -23,8 +23,12 @@ module Jekyll
site = context.registers[:site] site = context.registers[:site]
site.posts.each do |p| site.posts.each do |p|
if p.slug == @post.slug and p.date.year == @post.date.year and p.date.month == @post.date.month and p.date.day == @post.date.day if p.slug == @post.slug
return p.url and p.date.year == @post.date.year
and p.date.month == @post.date.month
and p.date.day == @post.date.day
p.url
end end
end end