diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index b1496de3..4afe82e6 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -218,7 +218,7 @@ module Jekyll :title => slug, :i_day => date.strftime("%-d"), :i_month => date.strftime("%-m"), - :categories => (categories || []).map { |c| c.to_s.downcase }.join('/'), + :categories => (categories || []).map { |c| c.to_s.downcase }.uniq.join('/'), :short_month => date.strftime("%b"), :short_year => date.strftime("%y"), :y_day => date.strftime("%j"), diff --git a/test/test_post.rb b/test/test_post.rb index 44cc9664..0e6861ce 100644 --- a/test/test_post.rb +++ b/test/test_post.rb @@ -276,6 +276,19 @@ class TestPost < Test::Unit::TestCase end end + context "with duplicated mixed case (categories)" do + setup do + @post.categories << "MixedCase" + @post.categories << "Mixedcase" + @post.process(@fake_file) + end + + should "process the url correctly" do + assert_equal "/:categories/:year/:month/:day/:title.html", @post.template + assert_equal "/mixedcase/2008/09/09/foo-bar.html", @post.url + end + end + context "with none style" do setup do @post.site.permalink_style = :none