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
Injected Open Graph meta tags interferes with already existing ones #476
Comments
Found a workaround. You can break it by putting a space in the head's closing tag, causing no meta tags to be injected: <head>
<!-- ... -->
</head > You can see it working on the Nu HTML checker with Discordbot's user agent. |
The reason specifically that your example is not working is because it's not correctly formed open graph meta. See the spec here: https://ogp.me/ It is possible that your version works on certain sites but it is not supposed to work, it is the incorrect properties, per the spec. I'm resolving this issue by being a lot more liberal with how the og detection works, which should resolve this and similar issues (a bunch of newlines in the tag, single quotes vs double). Expect this to be deployed in the next few days. |
Oh my god I feel dumb. Thanks! |
No worries, I think your way also works in practice, likely most people support it as an extra thing even though it isn't documented. Regardless the newlines are also an issue with our detection. The new approach is we're just going to look for "og:image" and friends as just a string without checking for meta, head, or location of that, and if we see it at all, we won't inject the data. |
It seems that Neocities now injects Open Graph tags if the user agent is detected to be a bot. However, if your website already has Open Graph tags, they interfere and give inconsistent results across platforms.
Example
With a plain webpage I created for this issue.
It displays my metadata on Discord:
However, it displays Neocities' injected metadata on Signal.
Solution
Perhaps something similar to GitHub Pages'
.nojekyll
to show that you don't want the meta tags, so you can have full creative control over your webpage.The text was updated successfully, but these errors were encountered: