Skip to content

Commit

Permalink
version bump 1.6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredwray committed Nov 30, 2021
1 parent 1e5e545 commit 5047eed
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "writr",
"version": "1.6.6",
"version": "1.6.7",
"description": "A Simple to Use Markdown Blog",
"main": "./dist/index",
"types": "./dist/index",
Expand Down
4 changes: 2 additions & 2 deletions src/render/atomRenderProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class AtomRenderProvider implements RenderProviderInterface{
//add in the posts
let posts = await data.getPostsByCount(config.indexCount);

posts.forEach(async (post) => {
for(let post of posts) {

let feedPost: any = {};
feedPost.title = post.title;
Expand All @@ -62,7 +62,7 @@ export class AtomRenderProvider implements RenderProviderInterface{
feedPost.published = post.date;

atomFeed.addItem(feedPost);
});
}

//write the feed atom.xml
await new StorageService(config).set(config.output + "/atom.xml", atomFeed.atom1());
Expand Down
15 changes: 8 additions & 7 deletions src/render/jsonRenderProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ export class JSONRenderProvider implements RenderProviderInterface {
let posts = await data.getPosts();
let tags = await data.getTags();

posts.forEach((post) => {
obj.posts.push(post.toObject());
});
for (let post of posts) {
let postObj: any = await post.toObject();
obj.posts.push(postObj);
}

for (let tag of tags) {
obj.tags.push(await tag.toObject());
}

tags.forEach((tag) => {
obj.tags.push(tag.toObject());
});

await new StorageService(config).set(config.output + "/data.json", JSON.stringify(obj));

result = true;
Expand Down
6 changes: 3 additions & 3 deletions src/tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ export class Tag {
return result;
}

toObject(): any {
async toObject(): Promise<any> {
let result: any = {};
result.name = this.name;
result.id = this.id;
result.posts = [];

this.posts.forEach((post) => {
result.posts.push(post.toObject());
this.posts.forEach(async (post) => {
result.posts.push(await post.toObject());
});

return result;
Expand Down

0 comments on commit 5047eed

Please sign in to comment.