This is a Jekyll plugin that adds a WebFinger file to your site, allowing you to use your own domain as an alias to help others discover your Mastodon profile.
Search Mastodon for @phil@philna.sh
and you will find my Mastodon profile.
You may be tempted to run your own Mastodon instance so that you can use your own domain. If you don't want the work of managing a server you can instead use your domain as an alias to point to your Mastodon profile.
This uses WebFinger, which is a way to attach information to an email address or other online resource. In this case you can point email addresses on your own domain to your Mastodon profile.
For example, I have a Mastodon profile at @philnash@mastodon.social. If I add this plugin to my Jekyll site at https://philna.sh and set the username to philnash
and the instance to mastodon.social
, then you will be able to find my account by searching for phil@philna.sh
in any Mastodon instance.
For a more in depth explanation, check out Mastodon on your own domain without hosting a server by Maarten Balliauw.
- @dkundel's netlify-plugin-mastodon-alias
- Lindsay Kwardell explains how to integrate Mastodon with Astro
Add the gem to your Jekyll site's Gemfile
by executing:
$ bundle add jekyll-mastodon_webfinger
Or by opening the Gemfile
, adding:
gem "jekyll-mastodon_webfinger"
and then running bundle install
.
You need to add two things to your _config.yml
file.
-
Add your Mastodon account details. For example:
mastodon: username: philnash instance: mastodon.social
-
Add
jekyll/mastodon_webfinger
to theplugins
list:plugins: - jekyll/mastodon_webfinger
Next time you build your Jekyll site, you will find a /.well-known/
directory in the output with a webfinger
file that contains the required JSON.
Since this generates a static file, this actually acts like a catch-all email address. @anything@yourdomain.com
will match and point to the Mastodon profile your define.
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
.**** To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and the created tag, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/philnash/jekyll-mastodon_webfinger. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
Everyone interacting in the Jekyll::MastodonWebfinger project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
The gem is available as open source under the terms of the MIT License.