AMP
  • 網站

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:要分享的網址。
  • data-media:要釘選的絕對圖片網址。
  • 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 設定為 embedPindata-url 屬性必須包含 Pinterest 資源的完整網址。

<amp-pinterest width="236" height="326" data-do="embedPin" data-url="https://www.pinterest.com/pin/228065168607834583/">
</amp-pinterest>
需要更多說明嗎?

如果此頁面上的說明未涵蓋您的所有問題,歡迎您與其他 AMP 使用者交流,討論您的確切使用案例。

前往 Stack Overflow
有未說明的特色功能嗎?

AMP 專案非常鼓勵您的參與和貢獻!我們希望您能成為我們開放原始碼社群的長期參與者,但我們也歡迎您針對您特別關注的問題做出一次性貢獻。

在 GitHub 上編輯範例