Add new attribute to tags (#84)

The new attribute makes it easier to apply custom styles to specific tags with CSS
This commit is contained in:
12-VidE 2023-03-02 08:11:57 +01:00 committed by GitHub
parent 18b4be3d43
commit f35dec903a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -211,7 +211,7 @@ module.exports = function (eleventyConfig) {
return (
str &&
str.replace(tagRegex, function (match, precede, tag) {
return `${precede}<a class="tag" onclick="toggleTagSearch(this)">${tag}</a>`;
return `${precede}<a class="tag" onclick="toggleTagSearch(this)" data-content="${tag}">${tag}</a>`;
})
);
});