mirror of
https://seed.radicle.dev/rad:z371PVmDHdjJucejRoRYJcDEvD5pp.git
synced 2026-10-18 19:10:34 +08:00
18 lines
400 B
Ruby
18 lines
400 B
Ruby
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)
|