amp-pinterest
简介
amp-pinterest
组件允许嵌入保存按钮或 Pin 小部件。
设置
在页眉中导入 amp-pinterest
组件。
<script async custom-element="amp-pinterest" src="https://cdn.ampproject.org/v0/amp-pinterest-0.1.js"></script>
保存按钮
将 data-do
设置为 buttonPin
以启用在您的网站上固定内容。以下属性是必需的
data-url
:要共享的 URL。data-media
:要固定的绝对图像 URL。data-description
:Pin 创建表单中显示的默认描述。
<amp-img src="/static/samples/img/amp.jpg" width="300" height="169" alt="an image"></amp-img>
<amp-pinterest height="18" width="56" data-do="buttonPin" data-url="https://amp.js.cn/documentation/examples/" data-media="https://amp.js.cn/documentation/examples/" data-description="amp-pinterest in action">
</amp-pinterest>
嵌入 Pin 小部件
要嵌入 Pin 小部件,请将 data-do
设置为 embedPin
。 data-url
属性必须包含 Pinterest 资源的完全限定 URL。
<amp-pinterest width="236" height="326" data-do="embedPin" data-url="https://www.pinterest.com/pin/228065168607834583/">
</amp-pinterest>
需要进一步解释吗?
如果此页面上的解释没有涵盖您所有的问题,请随时联系其他 AMP 用户讨论您的具体用例。
转到 Stack Overflow 未解释的功能?AMP 项目强烈鼓励您的参与和贡献!我们希望您能成为我们开源社区的持续参与者,但我们也欢迎您对您特别感兴趣的问题做出一次性贡献。
在 GitHub 上编辑示例-
由 @sebastianbenz 编写