Use your website hosted on Netlify as an alias for your Mastodon username.
Inspired by Maarten Balliauw's blog post and Phil Nash's Jekyll plugin
- You'll need your existing Mastodon username and instance. This project does not actually deploy a Mastodon instance.
- A working Netlify website wired up to your domain.
npm install netlify-plugin-mastodon-alias
To your netlify.toml
file add the following:
[[plugins]]
package = "netlify-plugin-mastodon-alias"
[plugins.inputs]
username = "YOUR_MASTODON_USERNAME"
instance = "YOUR_MASTODON_INSTANCE"
By default this will redirect any username on your domain to this username. For example both @hello@example.com and @bye@example.com would work. If you want to only match for one username then you can add the following configuration:
[[plugins]]
package = "netlify-plugin-mastodon-alias"
[plugins.inputs]
username = "YOUR_MASTODON_USERNAME"
instance = "YOUR_MASTODON_INSTANCE"
+ strictUsername = "hello"
In this case only @hello@example.com will continue to work but not @bye@example.com.
MIT