From ae1bf3f2bcf955fa8cf5d8a921516c0b8ec23260 Mon Sep 17 00:00:00 2001 From: Gabor Babicz Date: Mon, 9 Dec 2024 09:07:39 +0100 Subject: [PATCH] Add Mastodon handle support to author profiles --- .eleventy.js | 5 +++++ src/authors/zeppelin.md | 2 +- src/components/author-socials.njk | 11 +++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.eleventy.js b/.eleventy.js index 3bce290750..b913246ac9 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -225,6 +225,11 @@ module.exports = function (eleventyConfig) { return response.data.replace(" { + const [user, server] = handle.split("@").filter(Boolean); + return `https://${server}/@${user}`; + }); + eleventyConfig.setServerOptions({ watch: ["./dist/assets/css/*.css", "./dist/assets/js/*.js"], }); diff --git a/src/authors/zeppelin.md b/src/authors/zeppelin.md index a13f42c344..74ca7469d3 100644 --- a/src/authors/zeppelin.md +++ b/src/authors/zeppelin.md @@ -1,7 +1,7 @@ --- name: "Gabor Babicz" github: zeppelin -twitter: xeppelin +mastodon: "@gabor@babicz.social" linkedin: xeppelin bio: "Senior Software Engineer" --- diff --git a/src/components/author-socials.njk b/src/components/author-socials.njk index b05538ec3f..5437b8493f 100644 --- a/src/components/author-socials.njk +++ b/src/components/author-socials.njk @@ -21,6 +21,17 @@ {% endif %} + {% if author.data.mastodon %} +
  • + + {% include 'svg/social-mastodon.njk' %} + {{ author.data.mastodon }} on Mastodon + +
  • + {% endif %} {% endif %} {%- endmacro -%}