Hey, I’m trying to add a Mastodon profile verification link to my user profile pages:
Verification
You can verify yourself as the owner of the links in your profile metadata. For that, the linked website must contain a link back to your Mastodon profile. The link back must have a rel="me" attribute. The text content of the link does not matter. Here is an example:
I have forked the Clickable Social Icon Links on Profile TC and it displays the Mastodon link fine on the user profile pages, but since it renders as a handlebars template, it’s not visible in the ‘html/no javascript’ version and the Mastodon crawler won’t see it.
I noticed that the HTML version has the following section:
Ah, I didn’t explain myself well: users can enter their Mastodon URL as a custom field and I’d like to add a personal link for them to their own profile pages on my forum.
Basically you are suggesting that every site can verified all theirs users. So, because I have an account at mastodontti.fi I could add tags on my profile there and get verified.
Well… that is not exacly idea behind verification on Mastodon way.
You are missing the point. Then you could use what ever public Mastodon-server for that. And you are using quite wide definition of user of some site.
Yes you are because it dictates if your solution is right.
And it is. When there is empty or nill between opening and closing A-tag it works just fine, doesn’t show to visitors and doesnät need another CSS rule.
Sorry but it’s not. Take a look at the link under the Mastodon icon on my profile page here:
If you inspect the element, you’ll see the rel=“me” code, but if you view the page source, or load the page using wget or some tool like that, it’s not there as it’s generated client-side. A crawler won’t see that code.
I know I can add HTML to the page footer to verify just myself, but I want my users to be able to enter their Mastodon URL as a custom field, have it displayed on their profile pages and use that to verify themselves too.
To be sure we’re on the same page, are you trying to allow your users to verify themselves on Mastodon through your Discourse site by doing something similar to what’s outlined here: Get verified on Mastodon with your website | Opensource.com?
If so, maybe prompting users to add the link to either a regular post, or to their bio would work. Either of those would show up in the site’s crawler view. I don’t think it’s possible to override a crawler template from a theme component: Header Submenus - #134 by awesomerobot.
The issue I’m running into is that Discourse automatically strips the rel="me" attribute from the links. Unless there’s a work around for that, the attribute might need to be added to the AllowLister via a plugin. I’m not up to speed on Discourse/Mastodon integration, but this might be something that’s useful for other sites.
I think if you have it set to display on the profile page (so that it’ll be available on the page) then you can get a theme component to add it at some plugin outlet, and then add some css to hide the default display of it.
That’s all I know without pulling up an editor and looking at existing code. But maybe it’s enough of a hint.
I did that, but the problem remains that (I think) Theme Components are always rendered client-side, and their output won’t be visible to crawlers. I’ll just park this idea for now, it’s breaking my brain
Oh! Sorry. I couldn’t pay attention to all of this at one time. Yeah. You’ll need the plugin to add it to the non javascript version, so you’ll need to override the rails template, I guess.