feat: sort tags ignoring case and accents

feat/integration_ideo
Nicolas Doby 2022-10-18 09:50:23 +02:00
parent 41a5855b41
commit c90a2a3436
1 changed files with 3 additions and 1 deletions

View File

@ -61,7 +61,9 @@ module.exports = function(eleventyConfig) {
for(let item of collection) {
(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) {