feat: sort tags ignoring case and accents
parent
41a5855b41
commit
c90a2a3436
|
@ -61,7 +61,9 @@ module.exports = function(eleventyConfig) {
|
||||||
for(let item of collection) {
|
for(let item of collection) {
|
||||||
(item.data.tags || []).forEach(tag => tagSet.add(tag));
|
(item.data.tags || []).forEach(tag => tagSet.add(tag));
|
||||||
}
|
}
|
||||||
return Array.from(tagSet).sort();
|
return Array.from(tagSet).sort((a, b) => {
|
||||||
|
return a.localeCompare(b, undefined, {sensitivity: 'base'});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
eleventyConfig.addFilter("filterTagList", function filterTagList(tags) {
|
eleventyConfig.addFilter("filterTagList", function filterTagList(tags) {
|
||||||
|
|
Loading…
Reference in New Issue