Tuesday 22 October 2024

Setting up Author Attribution for Mastodon on a Blogger Blog

Mastodon, the open source/not owned by corporations social media platform recently added a feature called Author Attribution, which enables you to set up websites you own so that any link to one of your articles posted by anyone on Mastodon will show an author attribution link below it. This links the article to your Mastodon profile. Here is an example for a link posted to an article from this blog, as it appears on Mastodon.

That 'More from' link below it is the automatically generated Author Attribution link.

To set this up for your websites is a two step process. The first step is to add an author attribution meta tag to your website. This takes the following format:

<meta content='@drfootleg@fosstodon.org' name='fediverse:creator'/>

Of course you need to put your own Mastodon profile link in the content field, instead of my profile. 

As I host my blog on Blogger, I was not sure how I could put this custom meta tag into my blog site. Searching for information online took me to many posts all telling me about the support for meta content tags on Blogger. But these all pointed to the 'Search Description' meta tags section of the Blogger site settings page, and this does not allow you to set the name field (it just provides a way to add the text for the contents field of a description meta tag). So we have to get a little more hands on, which I found you can do by editing the HTML of your page theme.

Instead of 'Settings', you need to select 'Theme' in the left pane of the Blogger site editor page:


Then on the Theme page, look for the 'Customize' button at the top of the page, and select the downward pointing arrow on the end of this button:

This reveals a drop down menu where you can select the option to 'Edit HTML'. Choose this and you will be taken into the theme HTML editor. Up near the top of the HTML you can see the <head> tag. You insert <meta> tags below this. Here you can see the author attribution tag I inserted into my blog on line 6.


Insert your meta tag, and don't forget to click 'Save' on the toolbar. If you now view your blog, and press F12 in your browser to inspect the HTML of the site you should see the tag in your blog site HTML.

That's step 1 done. Now for step 2. This is where you allow your website to be used to generate author attribution links in Mastodon. Go into your Mastodon profile edit screen, and select the 'Verification' setting page. Scroll down past the 'Website Verification' settings (which hopefully you already used to tag your website as a way to verify yourself in the Fediverse?). Below this section you should see the 'Author Attribution' settings panel. Here you add the URLs of all the websites which you want to allow to be attributed to you on Mastodon. Without this part of the process, people could falsely attribute other websites to you. By requiring you to edit both your profile on Mastodon and the HTML of your websites, only you can control which websites are attributed to your Mastodon account. You can see my settings here:

As Blogger can use multiple URLs, I added the two most common ones my blog is accessed from here. Notice this page also shows you the syntax to use for your own meta tag, with a convenient 'copy' button.

That's all you need to do. Now when anyone posts a link to one of your blog articles on Mastodon, it should show an author attribution link below it automatically.