...
|
...
|
@@ -16,8 +16,9 @@
|
16
|
16
|
# - category_dir: The subfolder to build category pages in (default is 'categories').
|
17
|
17
|
# - category_title_prefix: The string used before the category name in the page title (default is
|
18
|
18
|
# 'Category: ').
|
19
|
|
-module Jekyll
|
|
19
|
+require "unicode_utils"
|
20
|
20
|
|
|
21
|
+module Jekyll
|
21
|
22
|
|
22
|
23
|
# The CategoryIndex class creates a single category page for the specified category.
|
23
|
24
|
class CategoryIndex < Page
|
...
|
...
|
@@ -68,7 +69,7 @@ module Jekyll
|
68
|
68
|
if self.layouts.key? 'category_index'
|
69
|
69
|
dir = self.config['category_dir'] || 'categories'
|
70
|
70
|
self.categories.keys.each do |category|
|
71
|
|
- self.write_category_index(File.join(dir, category.gsub(/_|\W/, '-')), category)
|
|
71
|
+ self.write_category_index(File.join(dir, UnicodeUtils.nfkd(category).gsub(/[^\x00-\x7F]/, '').gsub(/_|\W/, '-').to_s), category)
|
72
|
72
|
end
|
73
|
73
|
|
74
|
74
|
# Throw an exception if the layout couldn't be found.
|
...
|
...
|
@@ -105,7 +106,7 @@ module Jekyll
|
105
|
105
|
def category_links(categories)
|
106
|
106
|
dir = @context.registers[:site].config['category_dir']
|
107
|
107
|
categories = categories.sort!.map do |item|
|
108
|
|
- "<a class='category' href='/#{dir}/#{item.gsub(/_|\W/, '-')}/'>#{item}</a>"
|
|
108
|
+ "<a class='category' href='/#{dir}/#{UnicodeUtils.nfkd(item).gsub(/[^\x00-\x7F]/, '').gsub(/_|\W/, '-').to_s}/'>#{item}</a>"
|
109
|
109
|
end
|
110
|
110
|
|
111
|
111
|
case categories.length
|