+ /**
+ * Adds a remote
+ *
+ * @function addRemote
+ * @memberof Blog
+ * @return {Promise<undefined>} empty promise, returns no value
+ * @instance
+ */
+ async addRemote(remote) {
+
+ await ensureDirectoryExists(this.configDirectory);
+ await Remote.add(this.remoteConfig, remote);
+ }
+
+ /**
+ * Removes a remote
+ *
+ * @function removeRemote
+ * @memberof Blog
+ * @return {Promise<undefined>} empty promise, returns no value
+ * @instance
+ */
+ async removeRemote() {
+
+ await Remote.remove(this.remoteConfig);
+ }
+
+
+ /**
+ * Pulls the posts and archive from the remote
+ *
+ * @function syncDown
+ * @memberof Blog
+ * @return {Promise<undefined>} empty promise, returns no value
+ * @instance
+ */
+ async syncDown() {
+
+ internals.debuglog('Pulling remote state');
+ await ensureDirectoryExists(this.dataDirectory);
+ await Remote.syncDown(this.remoteConfig, this.dataDirectory);
+ internals.debuglog('Pulled remote state');
+ }
+
+ /**
+ * Pushes the posts and archive to the remote
+ *
+ * @function syncUp
+ * @memberof Blog
+ * @return {Promise<undefined>} empty promise, returns no value
+ * @instance
+ */
+ async syncUp() {
+
+ internals.debuglog('Pushing remote state');
+ await ensureDirectoryExists(this.dataDirectory);
+ await Remote.syncUp(this.remoteConfig, this.dataDirectory);
+ internals.debuglog('Pushed remote state');
+ }
+
+ // Adds the passed path to slot 0, and generates files.
+
+ async _update(postLocation) {
+
+ const metadata = await this._getMetadata();
+ await ensureDirectoryExists(this.postsDirectory);
+ await this._copyPost(postLocation);
+ await this._writeMetadata(metadata);
+
+ await this._archive(postLocation);
+
+ await this.generate();
+ try {
+ await this.syncUp();
+ }
+ catch {}
+ }
+
+