Couple of li'l adjustments to styles, and formatting of excerpts
Build and copy to prod / build-and-copy (push) Successful in 1m42s

This commit is contained in:
Lewis Dale committed 2024-03-14 07:34:33 +00:00
1 parent 5c0928922f
commit a540c0f1a5
4 files changed
+15 -19

No files matched your search

+6 -2
View File
@@ -1,6 +1,10 @@
module.exports = function (eleventyConfig) {
eleventyConfig.addFilter('excerpt', (content, limit = 250) => {
const excerpt = content.replace(/(<([^>]+)>)/gi, "").slice(0, limit) + " […]";
return excerpt;
const withoutTags = content.replace(/(<([^>]+)>)/gi, "");
if (withoutTags.length > limit) {
return withoutTags.slice(0, limit) + " […]";
}
return withoutTags;
});
}