- const index = ['# Unlimited Pizza Gemlog Archive', '',
- ...posts.map((post) => `=> ./${post.id}/${post.slug}`)].join('\n');
+ internals.debuglog('Generating Archive Index');
+ const indexLocation = join(templateDirectory, internals.kIndexName);
+
+ internals.debuglog(`Reading ${indexLocation}`);
+ const indexTemplate = await readFile(indexLocation, { encoding: 'utf8' });
+
+ internals.debuglog('Writing Archive Index');
+ const index = Dot.template(indexTemplate, {
+ ...Dot.templateSettings,
+ strip: false
+ })({
+ posts: posts.map((post) => internals.buildLink(post.id, post.slug)).join('\n')
+ });