【发布时间】:2015-02-18 10:51:29
【问题描述】:
我有一个面向公众的 SharePoint Foundation 2013 网站 http://www.oceanview335.com。它不是 SharePoint Online 网站。我正在尝试在母版页中构建元标记,以便我可以控制发布到 Facebook 时显示的数据。除了图像,我让它工作,这对我来说是最重要的部分。
这是我在母版页中的元标记:
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.oceanview335.com/SitePages/Home.aspx" />
<meta property="og:title" content="Ocean View Lodge No. 335" />
<meta property="og:site_name" content="Ocean View Lodge No. 335" />
<meta property="og:image"
content="http://www.oceanview335.com/Pictures/OV_eye_small.jpg" />
<meta property="og:description" content="Ocean View Masonic Lodge No. 335
A. F. & A. M. Norfolk, Virginia" />
根据我在 stackoverflow 和其他地方找到的建议,我添加了这一行:
<link rel="image_src" type="image/jpeg"
href="http://www.oceanview335.com/Pictures/OV_eye_small.jpg" />
使用 Facebook 的对象调试器,https://developers.facebook.com/tools/debug 我得到以下结果:
og:image was not defined, could not be downloaded or was not big enough.
Please define a chosen image using the og:image metatag, and use an image that's
at least 200x200px and is accessible from Facebook.
Image 'http://www.oceanview335.com/Pictures/2015%20DDGMs.png' will be used instead.
最终结果是,如果我在 Facebook 上创建新帖子,则会显示来自我主页“2015%20DDGMs.png”的图像。如果我对现有帖子发表评论,则会显示正确的图像“OV_eye_small.jpg”。我尝试了各种建议,例如将图像大小调整为 200x200 或其乘法。当前图像为 200x200。我试过 .png 和 .jpg 图像。我添加了上面列出的 image_src 链接。我通过谷歌搜索找到的任何尝试都没有删除这个“图像未定义”错误或在 Facebook 帖子中为我提供了正确的图像。
之前在 SharePoint.Stackexchange 上询问过,得到的回复为零。使用同样使用元标记的 Twitter Cards 可以完美运行:https://dev.twitter.com/cards/getting-started
【问题讨论】:
标签: facebook twitter sharepoint-2013 meta-tags