Mastodon now has an official share button for sites

https://lemmus.org/post/20618744

Cool. Just what we need on every website, another share button.

It’s different from the privacy tracking widgets. It’s just a link to a little joinmastodon.org web app that helps you share it on your instance. The website that hosts the button (or link) does not load any 3rd party scripts. If you enable the option to add a logo it will add an inline SVG image. The button as seen in the blog is the creation of the blog writer and only adds a bit of CSS to make it look like a button.

The code of the web app is opensource: github.com/mastodon/share

The CSS of the button can be found with inspect element.

GitHub - mastodon/share: Share widget for Mastodon

Share widget for Mastodon. Contribute to mastodon/share development by creating an account on GitHub.

GitHub