const StaticGenerator = require('./generators/static');
const HTMLGenerator = require('./generators/html');
const RSSGenerator = require('./generators/rss');
+const TXTGenerator = require('./generators/txt');
const internals = {
await this._copyPost(postLocation);
await this._writeMetadata(metadata);
- await this._generate();
+ await this.generate();
}
/**
// Parses markdown for each page, copies assets and generates index.
- async _generate() {
+ async generate() {
internals.debuglog('Generating output');
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
internals.debuglog('Parsing markdown');
posts.push({
...metadata,
- html: Marked(postContent)
+ index: i,
+ html: Marked(postContent),
+ raw: postContent
});
}
catch (error) {