-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Gradio meta tags override issue #10701
Labels
bug
Something isn't working
Comments
1 task
Thanks @zgreathouse we'll consider proposing an API for this! cc @dawoodkhan82 |
@zgreathouse Here was the script I wrote that worked:
|
+1 I'm encountering the same issue and looking for workaround for this issue. Is it possible to patch my gradio locally? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Problem Description
When attempting to set custom meta tags in a Gradio application via the head parameter for
Blocks
, Gradio overrides or conflicts with custom meta tags, particularly Open Graph and Twitter Card meta tags. This makes it difficult to properly set up social media previews for a Gradio application.Steps to Reproduce
(See attached sample code)
Expected Behavior
Custom meta tags provided through the head parameter should take precedence over any default meta tags Gradio adds, especially Open Graph and Twitter Card meta tags.
Actual Behavior
Gradio overwrites the custom meta tags with its own values.
The specific tags I notice this behavior with are:
property=og:description
property=og:image
name=twitter:creator
name=twitter:description
name=twitter:image
Impact
This issue prevents Gradio applications from properly setting up social media previews, which is critical for applications that are shared on platforms like Twitter, Facebook, Slack, and other social media sites. Without the ability to set custom meta tags, Gradio applications cannot control how they appear when shared on these platforms. (There are work arounds like serving the gradio app in an iframe, but it would be so much simpler if the
head
parameter worked as expected.)Possible Solution
Consider adding a specific parameter for social media meta tags or enhancing the existing head parameter to ensure custom meta tags take precedence over any default values.
Have you searched existing issues? 🔎
Reproduction
Screenshot
No response
Logs
System Info
Severity
I can work around it
The text was updated successfully, but these errors were encountered: