]> git.r.bdr.sh - rbdr/blog/blobdiff - lib/blog.js
Add TXT support
[rbdr/blog] / lib / blog.js
index 98efabdf1fc618636390ef5874704aa0f9028bc7..541d6b35da767e6771b7a48dbac9e079253b70c2 100644 (file)
@@ -9,6 +9,7 @@ const { debuglog, promisify } = require('util');
 const StaticGenerator = require('./generators/static');
 const HTMLGenerator = require('./generators/html');
 const RSSGenerator = require('./generators/rss');
+const TXTGenerator = require('./generators/txt');
 
 const internals = {
 
@@ -108,6 +109,7 @@ module.exports = class Blog {
     await StaticGenerator(this.postsDirectory, this.staticDirectory, posts);
     await HTMLGenerator(this.templatesDirectory, this.staticDirectory, posts);
     await RSSGenerator(this.templatesDirectory, this.staticDirectory, posts);
+    await TXTGenerator(this.templatesDirectory, this.staticDirectory, posts);
   }
 
   // Reads the posts into an array
@@ -134,7 +136,8 @@ module.exports = class Blog {
         internals.debuglog('Parsing markdown');
         posts.push({
           ...metadata,
-          html: Marked(postContent)
+          html: Marked(postContent),
+          raw: postContent
         });
       }
       catch (error) {