summaryrefslogtreecommitdiffstats
path: root/src/blog.11ty.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/blog.11ty.js')
-rw-r--r--src/blog.11ty.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/blog.11ty.js b/src/blog.11ty.js
new file mode 100644
index 0000000..eb79089
--- /dev/null
+++ b/src/blog.11ty.js
@@ -0,0 +1,23 @@
+module.exports = class {
+ data() {
+ return {
+ layout: "base",
+ title: "Blog"
+ };
+ }
+
+ render(data) {
+ return `<div role="feed" aria-busy="false">
+ ${(data.collections.posts || []).map((post, index, array) => `<article aria-posinset="${index}" aria-setsize="${array.len}">
+ <h1>
+ <a href="${post.url}">${post.data.title}</a>
+ </h1>
+ <small>
+ <time datetime="${data.page.date.toISOString()}">${data.page.date.toDateString()}</time> - <a rel=author href="${data.metadata.author.url}">${data.metadata.author.name}</a>
+ </small>
+ <p>${post.data.description}</p>
+ </article>
+ `).join()}
+ </div>`;
+ }
+};