-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Name vs Property in meta tags in page headers #3843
Comments
Well, it seems that Grav tries to distinguish between social metadata and other types of metadata by using the presence of a colon separator : and the Utils::startsWith() method for specific exceptions. However, the current logic applies property to any key that contains a : separator and does not start with 'twitter' or 'flattr'.
solves the problem. Now with:
the html output is:
|
Okay. So is this something I need to override on my local installs, or is this something that's going to be pushed to the main Grav code base and I can wait for it to get folded in and push with an update? (Since Masto's feature is still in beta anyway, I'm not in a rush.) |
Well, since it's a small change, I already made a pull request to the Grav development team |
Awesome! Thank you! Hopefully they'll pick it up and include it in the next release. I'll try to keep an eye on it. |
Context: Mastodon is introducing a new feature where if you include a meta tag with your fediverse handle, they'll put it into the link preview card as the author, making it easier for people to find you and read more of your content. This seems like a useful thing for a blog to make use of, so I decided to try to add the tag to my Grav sites. You can read more about it here: https://blog.joinmastodon.org/2024/07/highlighting-journalism-on-mastodon/
TL;DR: I want to include
<meta name="fediverse:creator" content="@[email protected]" />
to my Grav site.When I attempt to do this using either the admin panel site settings, or by directly editing
site.yaml
, it instead returns<meta property="fediverse:creator" content="@[email protected]" />
which is not what one needs for this particular meta tag. On the Grav Community forums, the closest we could get it is<meta name="fediverse:creator" property="fediverse:creator" content="@[email protected]" />
which isn't correct because you're not supposed to have both a name and a property attribute in the same meta tag. And if I edit anything else that gets saved tosite.yaml
via the admin panel (which, let's be honest, with ADHD, I'll likely forget and do so) it'll overwrite the work around we hacked together. https://discourse.getgrav.org/t/fediverse-creator-meta-tag/25652I can't find anything that allows me to specify which to use, or how it determines which is correct, but in this case it is not resulting in the correct thing. We need to be able to override the automagic detection when it gets it wrong like this... maybe default to whatever process the template uses, but if it's specified then instead use what's specified.
The text was updated successfully, but these errors were encountered: