From a8929901e3518b43552329032fb618e4f9967431 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Mon, 26 Feb 2024 12:40:33 -0500 Subject: [PATCH] Move author logic to frontmatter getter --- src/frontmatter/author.js | 5 +++++ src/parser.js | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 src/frontmatter/author.js diff --git a/src/frontmatter/author.js b/src/frontmatter/author.js new file mode 100644 index 0000000..ab5d78f --- /dev/null +++ b/src/frontmatter/author.js @@ -0,0 +1,5 @@ +// get author, without decoding +// WordPress doesn't allow funky characters in author names anyway +module.exports = (post) => { + return post.data.creator[0]; +} diff --git a/src/parser.js b/src/parser.js index ffca48f..e1dafa9 100644 --- a/src/parser.js +++ b/src/parser.js @@ -110,10 +110,6 @@ function getPostCoverImageId(postData) { return id; } -function getAuthor(post) { - return post.creator[0] -} - function collectAttachedImages(channelData) { const images = getItemsOfType(channelData, 'attachment') // filter to certain image file types