Remove duplicated mixed case categories
This commit is contained in:
parent
3768d90278
commit
c8d1c3d264
|
@ -218,7 +218,7 @@ module Jekyll
|
||||||
:title => slug,
|
:title => slug,
|
||||||
:i_day => date.strftime("%-d"),
|
:i_day => date.strftime("%-d"),
|
||||||
:i_month => date.strftime("%-m"),
|
: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_month => date.strftime("%b"),
|
||||||
:short_year => date.strftime("%y"),
|
:short_year => date.strftime("%y"),
|
||||||
:y_day => date.strftime("%j"),
|
:y_day => date.strftime("%j"),
|
||||||
|
|
|
@ -276,6 +276,19 @@ class TestPost < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
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
|
context "with none style" do
|
||||||
setup do
|
setup do
|
||||||
@post.site.permalink_style = :none
|
@post.site.permalink_style = :none
|
||||||
|
|
Loading…
Reference in New Issue