Couple of li'l adjustments to styles, and formatting of excerpts
Build and copy to prod / build-and-copy (push) Successful in 1m42s
Build and copy to prod / build-and-copy (push) Successful in 1m42s
This commit is contained in:
1 parent
5c0928922f
commit
a540c0f1a5
4 files changed
+15
-19
No files matched your search
@@ -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;
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user