Adding a “share to mastodon” link to any web site – and here https://christianheilmann.com/2023/08/18/adding-a-share-to-mastodon-link-to-any-web-site-and-here/
Adding a “share to mastodon” link to any web site – and here | Christian Heilmann

@codepo8 Like it ... but it is irritating that the first click on the button just take the instance name and "nothing" happens after that. User has to click the button again. Would be better to call the newly builded SHARE url right away.
@kiko Done. Building right now, should be live in a sec.
@codepo8 Great 😁 Do you share the new code with us in an article update?

@kiko
It is on Github, that makes more sense than adding features to bare bones demo.

You can even see the difference:
https://github.com/codepo8/mastodon-share/commit/90d44d0f7e8a443337752bdbef9994158e428299

Automatic redirect after setting the instance · codepo8/mastodon-share@90d44d0

A share to mastodon button. Contribute to codepo8/mastodon-share development by creating an account on GitHub.

GitHub