Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Fediverse Creator meta tag

admin

Solved by Karmalakas View solution

Started by Amy ☣ 2 years ago · 9 replies · 1210 views
2 years ago

Mastodon is adding a feature to allow people to include their fediverse handle on blogs and articles, to get them to display specially in the link card on Mastodon. (It's currently in beta and requires manual review by the mastodon.social team to turn on, which ug, hate that, but...) You can read about it here: https://blog.joinmastodon.org/2024/07/highlighting-journalism-on-mastodon/

It says to include <meta name="fediverse:creator" content="@[email protected]" /> in your page's head, so I go to the site configuration in the admin panel (or the site config file, either or) and I add my information (either in the two fields via the admin panel, or as 'fediverse:creator': '@[email protected]' in the site.yaml) and it shows up in the header of my page as <meta property="fediverse:creator" content="@[email protected]" /> using property instead of name.

Is there any way to get it to use name instead of property as it should?

2 years ago

It depends how you set your meta tags. Based on the template, It can be any or all of:

  • name
  • http_equiv
  • charset
  • property
  • content
2 years ago

I'm literally just setting it in site.yaml (tried both via the admin panel and directly editing the file in a text editor), I haven't made any changes to templates related to meta tags.

Looking at the file you linked, it's not clear to me how it decides which to use in the meta tag.

2 years ago

There is a section for metadata, and you add a line just like I quoted in my first post: 'fediverse:creator': '@[email protected]' and it plugs it into that template you linked and spits out the meta tag and places it in the header of the page.

My whole problem is that template looks at the information I put into the config and decides that the first piece of data should be in a property attribute instead of a name attribute like it should be.

I am trying to understand why it's getting that wrong and how to fix it.

2 years ago Solution

Try:

YAML
metadata:
  fediverse:
    creator: "@[email protected]"

It seems Grav has hardcoded logic for keys that contain : (semicolon) - it forces them as property

But if you resave it in Admin, it'll mess things up again
I'd suggest to report this to Grav Github repo as an issue

2 years ago

Okay, that's getting us closer? It put <meta name="fediverse:creator" property="fediverse:creator" content="@[email protected]" /> into the header of my page. Since the feature is still in beta on mastodon and doing the ask to be opted in nonsense, I don't know if that'll fly or break in their system yet. I might email them and ask.

I'll go fill in the issue on github in a bit, I was just headed out the door to run some errands.

8 months ago

Seems like Akkoma is unsupported ?

@[email protected]

will not be recognized if referenced ( my website f.e.)

Sad.

So much for Fediverse equality)

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 54 11 hours ago
Support · by Anna, 3 days ago
2 60 14 hours ago
Support · by Justin Young, 15 hours ago
1 30 15 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 57 5 days ago