6 lines
235 B
JavaScript
6 lines
235 B
JavaScript
module.exports = function (eleventyConfig) {
|
|
eleventyConfig.addFilter('excerpt', (content, limit = 250) => {
|
|
const excerpt = content.replace(/(<([^>]+)>)/gi, "").slice(0, limit) + " […]";
|
|
return excerpt;
|
|
});
|
|
} |