Skip to content
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

PNI: og image url is broken on prod and staging #4421

Closed
mmmavis opened this issue Mar 26, 2020 · 2 comments · Fixed by #4422
Closed

PNI: og image url is broken on prod and staging #4421

mmmavis opened this issue Mar 26, 2020 · 2 comments · Fixed by #4422

Comments

@mmmavis
Copy link
Collaborator

mmmavis commented Mar 26, 2020

og:image url is invalid on prod and staging.

Template code

<meta property="og:image" content="{{request.scheme}}://{{request.get_host}}{% static "_images/buyers-guide/evergreen-social.jpg" %}">

Source code from PNI prod

<meta property="og:image" content="https://foundation.mozilla.orghttps://assets.mofoprod.net/static/_images/buyers-guide/evergreen-social.78437e17fd46.jpg">

Source code from PNI staging

<meta property="og:image" content="https://foundation.mofostaging.nethttps://assets.mofostaging.net/static/_images/buyers-guide/evergreen-social.78437e17fd46.jpg">

https://foundation.mozilla.orghttps://assets.mofoprod.net/static/_images/buyers-guide/evergreen-social.78437e17fd46.jpg is not a valid URL.

@mmmavis mmmavis added this to the Apr 6 milestone Mar 26, 2020
@mmmavis mmmavis self-assigned this Mar 26, 2020
@mmmavis mmmavis changed the title PNI: og image url is broken PNI: og image url is broken on prod and staging Mar 26, 2020
@mmmavis
Copy link
Collaborator Author

mmmavis commented Mar 26, 2020

Changing it to content="{% static "_images/buyers-guide/evergreen-social.jpg"}" would solve the bug on prod and staging, but would break og:image locally as it generates a relative URL locally (e.g., /static/_images/buyers-guide/evergreen-social.jpg) and that we need an absolute URL for og:image to work.

og tags aren't useful for local development though. So I wonder if we can just ignore the local dev case?

@mmmavis
Copy link
Collaborator Author

mmmavis commented Mar 26, 2020

Fix is in. (We are just gonna ignore local dev scenario.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant