To verify a Mastodon account, one has to add the code below to the home page of a website. The code can be easily added to an Obsidian note that is published via Obsidian Publish.
However, because of the way Obsidian Publish builds the website pages, that code doesn’t show up on the published page, therefore Mastodon’s validation system can’t see it.
As for author attributions on articles, one has to add the code below to the home page of a website.
Just like mentioned above, it is possible to do it on a note, but, again, it is not visible on the website and Mastodon cannot use this to give attribution to authors.
Although the codes above can be in any part of the home page, probably a more broad solution that would cover other setting beyond Mastodon, would be to have some sort of head.html note, similar to publish.css where we could add codes like the above inside the <head></head> tags.
I have no idea. I’m not a dev. But you can try it yourself. Past the code to a note, publish it, and then look at the published page source code. The Mastodon codes will not be there.
As an additional note, my Mastodon account is currently verified because I did that before migrating to Obsidian Publish. If I change anything and save my profile again, Mastodon will look for the code and because it will not find it, the verification will be removed. I can confirm this with certainty, as I experienced it myself during the migration process to Obsidian Publish.
Unfortunately these are two distinct functionalities. One is about account verification, while the other is about author attribution. Both are important.