Move getPostExcerpt() into frontmatter getter

This commit is contained in:
Will Boyd
2024-02-26 11:45:06 -05:00
parent 932e7546fa
commit 635451a4e3
2 changed files with 5 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
// get excerpt, not decoded, newlines collapsed
module.exports = (post) => {
const excerpt = post.data.encoded[1].replace(/[(\r\n|\n|\r)]/gm, " ");
return excerpt;
};
-5
View File
@@ -110,11 +110,6 @@ function getPostCoverImageId(postData) {
return id; return id;
} }
function getPostExcerpt(post) {
const excerpt = post.encoded[1].replace(/(\r\n|\n|\r)/gm, " ");
return excerpt;
}
function collectAttachedImages(channelData) { function collectAttachedImages(channelData) {
const images = getItemsOfType(channelData, 'attachment') const images = getItemsOfType(channelData, 'attachment')
// filter to certain image file types // filter to certain image file types