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

Link preview image is missing #38

Open
cluhmann opened this issue Jun 21, 2022 · 10 comments
Open

Link preview image is missing #38

cluhmann opened this issue Jun 21, 2022 · 10 comments

Comments

@cluhmann
Copy link
Member

I went to post a pymc.io link in discourse and noticed that the preview discourse generated was missing at least one image (possibly two). I know there are CSS things that you can add to get various social media sites to correctly preview links. I suspect that this may be related to that (not exactly sure what discourse is trying to pull here):

image

@cluhmann cluhmann changed the title Site link preview image(s) Link preview image is missing Jun 21, 2022
@OriolAbril
Copy link
Member

I think the issue is that the extension we use to define these values removes the www part without which urls and links too images do not work. We currently add the extension in conf.py but don't add any configuration (it generally autoconfigures properly when using readthedocs). It looks like we need to configure it manually:

ogp_site_url = "https://www.pymc.io/"
ogp_image = "https://www.pymc.io/_static/PyMC.jpg"

Otherwise it uses https://pymc.io/_static/PyMC.jpg as the image link in the metadata

@OriolAbril
Copy link
Member

same thing might happen for the other sites too, not sure. Can you try if that happens with example notebooks or api pages?

@cluhmann
Copy link
Member Author

cluhmann commented Jun 21, 2022

Images missing for both API and examples. Text description/preview was also missing from API link (the examples link did have a text preview, however).

@OriolAbril
Copy link
Member

PR merged and website rebuilt. Can you check it works now? This can't really be tested reliably on the previews

@cluhmann
Copy link
Member Author

Hm, that doesn't seem to have changed anything. Checking here, it looks like everything is detected ok and the only "complaint" is that that image aspect ratio is a bit wide. But I'm not sure what's up with discourse.

@OriolAbril
Copy link
Member

Maybe there is some kind of caching issue? I really don't know what I'm doing 😅

@cluhmann
Copy link
Member Author

I tried flushing and refreshing. Let me try logging out and back in?

@cluhmann
Copy link
Member Author

Nope ☹️

@OriolAbril
Copy link
Member

I do see the image, but not the favicon thingy. This might be related: https://meta.discourse.org/t/onebox-uses-wrong-url-for-the-favicon-in-link-preview/217074

@cluhmann
Copy link
Member Author

That seems to be a problem with the favicon. We're missing the main preview image.

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

No branches or pull requests

2 participants