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.dev.org.tw/documentation/examples/" data-media="https://amp.dev.org.tw/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 撰寫