/netlify-plugin-mastodon-alias

Netlify build plugin to create a redirect from your site to your mastodon profile

Primary LanguageJavaScriptMIT LicenseMIT

netlify-plugin-mastodon-alias

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

Requirements

  1. You'll need your existing Mastodon username and instance. This project does not actually deploy a Mastodon instance.
  2. A working Netlify website wired up to your domain.

Installation

npm install netlify-plugin-mastodon-alias

Configuration

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.

License

MIT