- const index = [
- '# Unlimited Pizza Gemlog Archive', '',
- '=> https://blog.unlimited.pizza/feed.xml ð° RSS Feed',
- '=> https://blog.unlimited.pizza/index.txt ð http text version (latest 3 posts)',
- '',
- ...posts.map((post) => internals.buildLink(post.id, post.slug)),
- '', '=> ../ ðŠī Back to main page'
- ].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')
+ });