将 "nopin" 应用于 "og:image"

apply "nopin" to "og:image"

我不是编码员,但我能够通过在本网站上不停地搜索 "how to do xxxx" 来构建我的网站。非常感谢大家的帖子和信息!

我想知道如何将 pinterest 的 "nopin" 标签应用到我的 "og:image"

这是一个 link 示例页面 http://jamesngart.com/harvester.html

我制作了一张水平裁剪的插图图像,用作 facebook 和 twitter link 的 og:image,但我不想让 pinterest 接收它。我对一些我不想固定的图像使用了 nopin 标签并且它起作用了,但我似乎无法将它应用到 OG:image.

pin interest 也没有获取我输入的任何数据 pin 信息,我想添加 "this is a cropped image please pin the others" 但没有任何效果。这是我的代码:

    <meta property="og:image" content="http://jamesngart.com/img/OG-Harvester.jpg" nopin="nopin" />

谢谢!

詹姆斯

在网上阅读有关此的各种文章,特定图像的指南似乎很少,但是这个

http://allyssabarnes.com/2013/07/22/how-to-block-your-images-from-being-pinned/

link 显示:

<meta name="pinterest" content="nopin" description="Enter your new description here" />

<img src="your-image.png" nopin="nopin">

这让我确定,由于 Opengraph 是一项 meta 功能,您需要执行以下操作:

 <meta property="og:image" content="jamesngart.com/img/OG-Harvester.jpg" nopin="nopin" />

我也希望您也能使用 https://developers.pinterest.com/docs/getting-started/introduction/ 作为参考。

另见

这实际上表明(截至 2012 年)Pinterest 在其处理过程中并未直接引用 OG:images

总的来说,您为什么要在 OpenGraph 上共享图片(即用于 Facebook 和 Google 搜索)有点值得怀疑,而 Pinterest 将无法使用该图片。

不要将 nopin 属性添加到 facebook open (og) graph metatag。

而是创建一个新的元标记并将其添加到 opengraph 标记的下方或上方。 在以下示例中 - 整个页面禁用固定:

<meta property="og:image" content="jamesngart.com/img/OG-Harvester.jpg" /> <meta name="pinterest" content="nopin" />

如果您想禁用每张图片的固定功能,您必须将 nopin 属性添加到图片 (IMG) 标签中:

<img src="jamesngart.com/img/OG-Harvester.jpg" nopin="nopin" />

阅读更多关于 pinterest data-attributes and metatags in this article at csstricks