Browse code

Downcased category urls

Brandon Mathis authored on 05/09/2011 at 13:06:20
Showing 1 changed files
... ...
@@ -70,7 +70,7 @@ module Jekyll
70 70
       if self.layouts.key? 'category_index'
71 71
         dir = self.config['category_dir'] || 'categories'
72 72
         self.categories.keys.each do |category|
73
-          self.write_category_index(File.join(dir, category.gsub(/_|\P{Word}/, '-').gsub(/-{2,}/, '-')), category)
73
+          self.write_category_index(File.join(dir, category.gsub(/_|\P{Word}/, '-').gsub(/-{2,}/, '-').downcase), category)
74 74
         end
75 75
 
76 76
       # Throw an exception if the layout couldn't be found.
... ...
@@ -107,7 +107,7 @@ module Jekyll
107 107
     def category_links(categories)
108 108
       dir = @context.registers[:site].config['category_dir']
109 109
       categories = categories.sort!.map do |item|
110
-        "<a class='category' href='/#{dir}/#{item.gsub(/_|\P{Word}/, '-').gsub(/-{2,}/, '-')}/'>#{item}</a>"
110
+        "<a class='category' href='/#{dir}/#{item.gsub(/_|\P{Word}/, '-').gsub(/-{2,}/, '-').downcase}/'>#{item}</a>"
111 111
       end
112 112
 
113 113
       case categories.length