Skip to content

Commit

Permalink
fix tags
Browse files Browse the repository at this point in the history
  • Loading branch information
aldimhr committed Jun 8, 2021
1 parent 4965dc3 commit dfcb54d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ module.exports = (config) => {
return `${da} ${mo} ${ye}`;
});
config.addNunjucksFilter('displayUrl', function (url) {
const pattern = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_\+.~#?&=]*)/;
const pattern =
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_\+.~#?&=]*)/;
const ret = url.match(pattern);
return ret ? ret[0] : url;
});
Expand Down Expand Up @@ -118,6 +119,7 @@ module.exports = (config) => {
(item.data.tags || []).forEach((tag) => {
tagSet.add(tag.toLowerCase());
});
});

return [...tagSet];
});
Expand Down

0 comments on commit dfcb54d

Please sign in to comment.