A cartoon of a Ghost and a Mastodon hugging

Adding Mastodon author attribution to Ghost

How to add the Mastodon author attribution to your single author Ghost site.

Adam Tinworth
Adam Tinworth

With the release of Mastodon 4.3, the federated social platform now supports authorship attribution. It's a method of highlighting an article's author when the article is shared on Mastodon. The author's name becomes a clickable link to their Mastodon account, hopefully leading to an uptick in followers:

In this version we’re introducing a new way to highlight writers and journalists on the fediverse. By adding a single line to their HTML, publishers can feature the fediverse profile of the page author in the link previews on Mastodon. That way, when lots of different people are sharing the link, or the link is trending in the News tab, you can easily navigate to the author’s fediverse profile and follow them right from within Mastodon to receive future updates. Publications like The Verge and TechCrunch are already using this.

This is what it looks like:

An iPad screenshot showing Mastodon Author attribution in the official app.
Mastodon Author Attribution showing up in the official app.

And here's how I set it up, based on this guide.

The Ghost end

So, first things first:

  • Head to your Ghost settings and search for “Code Injection”
  • In the Head section paste in the following code:
<meta name="fediverse:creator" content="@adders@masto.onemanandhisblog.com" />

(Make sure to replace my Mastodon account with yours…)

Hit save, and you're done.

The Mastodon end

Then, you're off to your Mastodon settings. This will only work if your instance has been upgraded to Mastodon 4.3 or above.

  • Go to Settings -> Profile -> Verification
  • Add the domain you've added the metadata to in the Author attribution box at the bottom.
  • Hit save.

You're all done. In future, any article you — or anyone else — shares on Mastodon will have a neat, clickable author link that brings the readers straight to your Mastodon profile, where they can follow you.

👴
The older readers amongst you might recognise this: it's very similar to the Google Authorship markup that created reciprocal links between your site and Google+, and gave you byline photos is search results…

Mastodon clients apps will need to support it too. But some already do. For example, this is how it looks in Ivory, my preferred iOS Mastodon client:

Mastodon Author Attribution in Ivory
The green name is a clickable link
👥
The solution I've outlined above is for a single author blog. If you have a multi-author site, you're probably going to have to write some conditional code and add it into your templates. I'm tempted to explore that, but the only multi-author Ghost site I have access to has only one author with a Mastodon account: me. 🤷

That said, it's probably better to wait to see how the Ghost Activity Pub implementation works out, as it might cover much of this.
mastodonghost

Adam Tinworth Twitter

Adam is a digital journalism lecturer, trainer and writer. He's been a blogger for over 20 years, a journalist for 30 and teaches audience strategy and engagement at City St George’s, London.

Comments