summary refs log tree commit diff
path: root/lib/index.ts
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-08-07 21:59:19 +0200
committerGitHub <noreply@github.com>2020-08-07 21:59:19 +0200
commitb994a4475855f98c1bc89997c581e6685abf94dd (patch)
tree21b2a6b575039c6c8274929e9e191d8723c44e12 /lib/index.ts
parentc941b9a7066f6fe5cfebf159feb7d00cd316f64d (diff)
parenta29d97d7f7c8c26896ea9e7e0b52bf6aa1ea71d0 (diff)
downloadkronikarz-b994a4475855f98c1bc89997c581e6685abf94dd.tar.gz
kronikarz-b994a4475855f98c1bc89997c581e6685abf94dd.zip
Merge pull request #17 from pniedzwiedzinski/rss-feed v2.1.0
Rss feed
Diffstat (limited to 'lib/index.ts')
-rw-r--r--lib/index.ts17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/index.ts b/lib/index.ts
index 4bf4dd3..3eddf7a 100644
--- a/lib/index.ts
+++ b/lib/index.ts
@@ -1,6 +1,8 @@
+import { FeedOptions } from "./interfaces";
 import { getPost as apiGetPost } from "./getPost";
 import { getPosts as apiGetPosts } from "./getPosts";
-import { generateApi as apiGenerateApi } from "./generateApi"
+import { generateApi as apiGenerateApi } from "./generateApi";
+import { generateRss as apiGenerateRss } from "./generateRss";
 import Post from "./Post";
 
 export default class Kronikarz {
@@ -13,11 +15,18 @@ export default class Kronikarz {
   getPosts(): Array<Post> {
     return apiGetPosts(this.postPath);
   }
+
   getPost(year: string, month: string, day: string, title: string): Post {
     return apiGetPost({ year, month, day, title }, this.postPath);
   }
-    generateApi(path: string) {
-      const posts = this.getPosts();
-      apiGenerateApi(posts, path)
+
+  generateApi(path: string) {
+    const posts = this.getPosts();
+    apiGenerateApi(posts, path)
+  }
+
+  generateRss(path: string, feedOptions: FeedOptions) {
+    const posts = this.getPosts();
+    apiGenerateRss(posts, path, feedOptions);
   }
 }