Radish alpha
r
rad:z371PVmDHdjJucejRoRYJcDEvD5pp
Radicle website including documentation and guides
Radicle
Git
fedi: Plugin to turn handles into HTTPS URLs
Lorenz Leutgeb committed 5 months ago
commit 62f9b1606c855f908ec809c59f224c9bb4b98ec4
parent 47f4503
5 files changed +21 -4
modified _layouts/blog.html
@@ -22,8 +22,8 @@
      <p class="subtitle">{{ page.subtitle }}</p>
      <span class="author">
	      Published by <a href="https://app.radicle.xyz/nodes/{{author.radicle.node | default: site.node }}/users/{{author.radicle.did}}">{{author.name}}</a>
-
	{% if author.fedi %}<a href="{{ author.fedi | remove_first: "@" | split: "@" | reverse | join: "/@" | prepend: "https://" }}">🐘</a>{% endif %}
	{% if author.atproto %}<a href="{{ author.atproto | prepend: "https://bsky.app/profile/" }}">🦋</a>{% endif %}
+
	{% if author.fedi %}<a href="{{ author.fedi | fedi_to_https }}">🐘</a>{% endif %}
	{% if author.web %}<a href="https://{{ author.web }}">🌐</a>{% endif %}
        on {{ page.date | date: "%d.%m.%Y" }}
      </span>
modified _layouts/index.html
@@ -3,7 +3,7 @@
<head>
{% include meta.html %}
<link rel="stylesheet" type="text/css" href="{{ "/assets/css/page.css" | relative_url }}"/>
-
<meta rel="me" href="https://toot.radicle.xyz/@radicle" />
+
<meta rel="me" href="{{ site.fedi | fedi_to_https }}" />
<link rel="alternate" type="application/rss+xml" title="RSS Feed for the Radicle Website" href="/feed.xml" />
</head>
<body>
modified _layouts/post.html
@@ -18,7 +18,7 @@
      {{ content }}
    </main>
    <aside>
-
      <p><strong>Follow us</strong> on 🐘 <a href="https://toot.radicle.xyz/@radicle">Mastodon</a> or 🦋 <a href="https://bsky.app/profile/{{ site.atproto }}">Bluesky</a>.</p>
+
      <p><strong>Follow us</strong> on 🐘 <a href="{{ site.fedi | fedi_to_https }}">Mastodon</a> or 🦋 <a href="https://bsky.app/profile/{{ site.atproto }}">Bluesky</a>.</p>
      <p><strong>Contribute</strong> to Radicle as a 🌱 <a href="/guides/seeder">seeder</a>, 🧙 <a href="https://app.radicle.xyz/nodes/seed.radicle.xyz/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5">developer</a> or by 🪞 <a href="/guides/user/#git-going-with-repositories">mirroring</a> your repositories on the Radicle network.</p>
      <p><strong>Join</strong> our community on 💬 <a href="https://radicle.zulipchat.com">Zulip</a> and discuss your ideas to improve Radicle.</p>
    </aside>
added _plugins/fedi.rb
@@ -0,0 +1,17 @@
+
module Jekyll
+
  module Fedi
+
    # Takes a handle of the form "@someone@toot.example.com"
+
    # and transforms it to a profile URL of the form
+
    # "https://toot.example.com/@someone".
+
    def fedi_to_https(input)
+
      input
+
        .sub('@', '')
+
        .split('@')
+
        .reverse
+
        .join('/@')
+
        .prepend('https://')
+
    end
+
  end
+
end
+

+
Liquid::Template.register_filter(Jekyll::Fedi)
modified index.md
@@ -165,8 +165,8 @@ channel on Zulip.

[install-script]: /install
[twitter]: https://twitter.com/radicle
-
[mast]: https://toot.radicle.xyz/@radicle
[bsky]: https://bsky.app/profile/{{ site.atproto }}
+
[mast]: {{ site.fedi | fedi_to_https }}
[zulip]: https://radicle.zulipchat.com
[heartwood]: https://app.radicle.xyz/nodes/seed.radicle.xyz/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
[desktop]: /desktop