我想在我网站的元标记中使用来自S3存储桶的非公开图像。
我的<head>
看起来像这样:
<meta property="og:image" content="<%= asset_path @list.image %>" />
像这样的来源:
<meta property="og:image" content="//mybucket-main.s3.amazonaws.com/uploads/asdflkj/myimage.jpg" />
当我在整个网站中包含它们时,我的图像呈现完美:
<%= image_tag @list.image %>
变为
<img src="//mybucket.s3.amazonaws.com/uploads/asdflkj/myimage.jpg" alt="myimage" />
。
(顺便说一下,如果我使用真实的src
,它甚至会在这篇文章中呈现。)
我从https://developers.facebook.com/tools/debug/sharing收到此错误:
Object Invalid Value: Object at URL 'https://example.com/lists/1462' of type 'website' is invalid because the given value '//mybucket.s3.amazonaws.com/uploads/image.jpg' for property 'og:image:url' could not be parsed as type 'url'.
请帮忙!