Skip to content

Commit

Permalink
Remove extract options (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwojcik authored Mar 26, 2024
1 parent 0648fa8 commit dfe6ec7
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,31 +60,6 @@ module.exports = function (eleventyConfig) {
},
});

const extractOptions = {
getExtraEntryFields: (item) => {
try {
if (item.content["#text"]?.length > 0) {
const htmlDescription = stripAndTruncateHTML(
item.content["#text"],
siteConfig.maxPostLength
);

return {
htmlDescription,
};
} else {
return {
htmlDescription: "",
};
}
} catch (error) {
return {
htmlDescription: "",
};
}
},
};

const parsedFeedData =
feedType === "json" && typeof feedData === "string"
? JSON.parse(feedData)
Expand All @@ -102,7 +77,7 @@ module.exports = function (eleventyConfig) {
),
})),
}
: extractor.extractFromXml(feedData, extractOptions);
: extractor.extractFromXml(feedData);

return feedContent.entries
.map((entry) => ({
Expand Down

0 comments on commit dfe6ec7

Please sign in to comment.