a540c0f1a5
All checks were successful
Build and copy to prod / build-and-copy (push) Successful in 1m42s
10 lines
328 B
JavaScript
10 lines
328 B
JavaScript
module.exports = function (eleventyConfig) {
|
|
eleventyConfig.addFilter('excerpt', (content, limit = 250) => {
|
|
const withoutTags = content.replace(/(<([^>]+)>)/gi, "");
|
|
|
|
if (withoutTags.length > limit) {
|
|
return withoutTags.slice(0, limit) + " […]";
|
|
}
|
|
return withoutTags;
|
|
});
|
|
} |