about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorAlan Pearce2023-11-10 12:35:22 +0100
committerAlan Pearce2023-11-10 12:48:10 +0100
commit95e3c528594f6137d7d8310c8e4231283c35933b (patch)
tree70dd3e8ba5c1da9f570d842d41b5cc5cb80ddfd7 /src
parent9803beaca39fbccd38ab3a461a5e29d6e6d45c47 (diff)
downloadwebsite-95e3c528594f6137d7d8310c8e4231283c35933b.tar.lz
website-95e3c528594f6137d7d8310c8e4231283c35933b.tar.zst
website-95e3c528594f6137d7d8310c8e4231283c35933b.zip
Template "elsewhere on the internet" links
Diffstat (limited to 'src')
-rw-r--r--src/templates.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/templates.ts b/src/templates.ts
index a134723..b8139f6 100644
--- a/src/templates.ts
+++ b/src/templates.ts
@@ -69,6 +69,16 @@ async function renderHomepage(posts: Array<Post>): Promise<string> {
       .text(post.date.toISOString().slice(0, 10));
     $post.appendTo($feed);
   }
+
+  $(".u-email").attr("href", `mailto:${config.email}`).text(config.email);
+  const $elsewhere = $(".elsewhere");
+  const $linkRelMe = $elsewhere.find(".u-url[rel=me]").parentsUntil("ul");
+  $linkRelMe.remove();
+  for (const link of config.menus.me) {
+    const $link = $linkRelMe.clone();
+    $link.find("a").attr("href", link.url).text(link.name);
+    $link.appendTo($elsewhere);
+  }
   return $.html();
 }