- 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);
+ // Start from a clean slate.
+ await rmIfExists(this.blogOutputDirectory);
+ await ensureDirectoryExists(this.blogOutputDirectory);
+
+ // Run each generator
+ await StaticGenerator(this.staticDirectory, this.blogOutputDirectory, posts);
+ await HTMLGenerator(await this._templateDirectoryFor('index.html'), this.blogOutputDirectory, posts);
+ await RSSGenerator(await this._templateDirectoryFor('feed.xml'), this.blogOutputDirectory, posts);
+ await TXTGenerator(await this._templateDirectoryFor('index.txt'), this.blogOutputDirectory, posts);
+
+ // Start from a clean slate.
+ await rmIfExists(this.archiveOutputDirectory);
+ await ensureDirectoryExists(this.archiveOutputDirectory);
+ await ensureDirectoryExists(this.archiveDirectory);