From c90a2a343675c26ef51e1e09d8e11a0a585cec04 Mon Sep 17 00:00:00 2001 From: Nicolas Doby Date: Tue, 18 Oct 2022 09:50:23 +0200 Subject: [PATCH] feat: sort tags ignoring case and accents --- eleventy.config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eleventy.config.js b/eleventy.config.js index 2105548..6b0e8d3 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -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) {