+ // Reads an individual post
+
+ async _readPost(index=0) {
+ const postSourcePath = join(this.postsDirectory, `${index}`);
+
+ internals.debuglog(`Reading ${postSourcePath}`);
+
+ await access(postSourcePath);
+
+ const metadata = await this._getMetadata(index);
+
+ const postContentPath = await this._findBlogContent(postSourcePath);
+ internals.debuglog(`Reading ${postContentPath}`);
+ const postContent = await readFile(postContentPath, { encoding: 'utf8' });
+
+ internals.debuglog('Parsing Gemini');
+ return {
+ ...metadata,
+ location: postSourcePath,
+ index,
+ html: RenderGemini(ParseGemini(postContent)),
+ raw: postContent
+ };
+ }
+