rfelix / my_jekyll_extensions

Portable Jekyll extensions I use for my website (to be used with jekyll_ext)
http://rfelix.com/2010/01/19/jekyll-extensions-minus-equal-pain/
57 stars 11 forks source link

logic problem with tag_gen.rb, patch to push related tags only once #1

Closed mmehnert closed 14 years ago

mmehnert commented 14 years ago
diff --git a/tag_gen/tag_gen.rb b/tag_gen/tag_gen.rb
index 8bbc038..7facac6 100644
--- a/tag_gen/tag_gen.rb
+++ b/tag_gen/tag_gen.rb
@@ -22,7 +22,7 @@ module Jekyll
       related = []
       site.tags[tag].each do |post|
         post.tags.each do |rel| 
-          related.push(rel) unless rel == tag && related.include?(rel)
+          related.push(rel) unless rel == tag || related.include?(rel)
         end
       end      
       self.data['related'] = related unless related.empty?
rfelix commented 14 years ago

Ah damn, even though it's danc's stuff, he had it right in the beginning. I then suggested a few alterations and then proposed he compress the if statements with the unless and translated it badly! Thank's for that (/me embarrassed)! I'll be sure to let him know and fix it tomorrow ;)

rfelix commented 14 years ago

Just saw that danc also detected the problem and has resolved it. I only saw his pull request now. This issue has now been closed :)