From 932e7546faf8d2a511205afb634da79112af5ec2 Mon Sep 17 00:00:00 2001 From: Eka <6597211+ekafyi@users.noreply.github.com> Date: Sat, 28 Mar 2020 22:04:44 +0700 Subject: [PATCH] add post excerpt to frontmatter --- src/parser.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/parser.js b/src/parser.js index e1dafa9..0a82f3e 100644 --- a/src/parser.js +++ b/src/parser.js @@ -110,6 +110,11 @@ function getPostCoverImageId(postData) { return id; } +function getPostExcerpt(post) { + const excerpt = post.encoded[1].replace(/(\r\n|\n|\r)/gm, " "); + return excerpt; +} + function collectAttachedImages(channelData) { const images = getItemsOfType(channelData, 'attachment') // filter to certain image file types