问题原文
原帖链接 · Robert Cooper · CC BY-SA 4.0
For some reason, when I share a URL to my blog post on LinkedIn, the image specified in the og:image tag does not appear in the share LinkedIn post.
URL shared: https://robertcooper.me/post/feature-flags
og:image meta tag found in the page's head:
<meta property="og:image" content="https://www.robertcooper.me/api/og-image/Building%20with%20feature%20flags?readTime=6">
The LinkedIn post inspector confirms that the image won't show up when shared: https://www.linkedin.com/post-inspector/inspect/https:%2F%2Frobertcooper.me%2Fpost%2Ffeature-flags
Testing things out on other websites, I looked at how sharing this URL looks like: https://css-tricks.com/
This shows up correctly on LinkedIn (as confirmed by the LinkedIn post inspector: https://www.linkedin.com/post-inspector/inspect/https:%2F%2Fcss-tricks.com%2F).
已采纳解答
原帖链接 · Zhaph - Ben Duguid · CC BY-SA 4.0
Your image request is actually returning a 308 response, directing to:
https://robertcooper.me:443/api/og-image/Building with feature flags?readTime=6
Note the addition of the port and the %20 s being returned to spaces.
Also, I seem to recall in the past that LinkedIn got upset if the og:image path didn't look like a file (e.g. ending in .jpg or .png).
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
