-
-
Notifications
You must be signed in to change notification settings - Fork 209
Closed as not planned
Description
Here's my code:
const files = fs.readdirSync(path.join('posts'));
files.map((filename) => {
const slug = filename.replace('.md', '');
const markdownWithMeta = fs.readFileSync(path.join('posts', filename), 'utf-8');
const {data, content} = matter(markdownWithMeta);
const maximumExcerptSize = 80
if(data.excerpt.length > maximumExcerptSize){
data.excerpt = data.excerpt.substr(0, maximumExcerptSize) + '...';
}
const url = `${baseUrl}/${slug}`;
const item: Item = {
title: data.title,
image: data.cover_image,
link: url.toString(),
date: new Date(),
id: slug,
description: data.excerpt,
content: data.content,
author: [data.author],
contributor: [author],
}
feed.addItem(item);
});
All the others feeds functions work except for atom1() that returns:
error - TypeError: url.replace is not a function
My first ideas was that some url paramter was in another format, so I transformed it to string, but the error continues.
If I remove the add item code the error desapears
cheeaun, EliasVincent and auroraanna
Metadata
Metadata
Assignees
Labels
No labels