const internals = {
blog: new Blog(Config),
- expectedKeys: ['add', 'update', 'publish'],
+ expectedKeys: ['add', 'generate', 'update', 'publish'],
// Application entry point. Reads arguments and calls the
// corresponding method from the blog lib
return;
}
+ if (argument === 'generate') {
+ await internals.blog.generate();
+ return;
+ }
+
if (argument === 'publish') {
await internals.blog.publish(value);
return;
console.error('\nUsage:\n');
console.error('blog --add path/to/blog_post\t\t(creates new blog post)');
- console.error('blog --update path/to/blog_post\t(updates latest blog post)');
- console.error('blog --publish \t\t\t(publishes the blog)');
+ console.error('blog --update path/to/blog_post\t\t(updates latest blog post)');
+ console.error('blog --generate \t\t\t(generates the blog assets)');
+ console.error('blog --publish \t\t\t\t(publishes the blog)');
}
};
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');