AMP

重要事項:本文件不適用於您目前選取的格式 廣告

amp-reddit

說明

顯示 Reddit 留言或貼文嵌入內容。

 

必要指令碼

<script async custom-element="amp-reddit" src="https://cdn.ampproject.org/v0/amp-reddit-0.1.js"></script>

範例

使用 amp-reddit 元件來嵌入 Reddit 貼文或留言。

範例:嵌入 Reddit 貼文

<amp-reddit
  layout="responsive"
  width="300"
  height="400"
  data-embedtype="post"
  data-src="https://www.reddit.com/r/me_irl/comments/52rmir/me_irl/?ref=share&amp;ref_source=embed"
>
</amp-reddit>

範例:嵌入 Reddit 留言

<amp-reddit
  layout="responsive"
  width="400"
  height="400"
  data-embedtype="comment"
  data-src="https://www.reddit.com/r/sports/comments/54loj1/50_cents_awful_1st_pitch_given_a_historical/d8306kw"
  data-uuid="b1246282-bd7b-4778-8c5b-5b08ac0e175e"
  data-embedcreated="2016-09-26T21:26:17.823Z"
  data-embedparent="true"
  data-embedlive="true"
>
</amp-reddit>

屬性

data-embedtype (必填) 嵌入類型,postcomment
data-src (必填) 貼文或留言的永久連結 URI。
data-uuid 留言嵌入內容的 UUID。當 data-embedtypecomment 時支援。
data-embedcreated 留言嵌入內容的日期時間字串。當 data-embedtypecomment 時支援。
data-embedparent 留言嵌入內容的日期時間字串。當 data-embedtypecomment 時支援。
data-embedlive 指出嵌入的留言是否應在原始留言更新時更新。當 data-embedtypecomment 時支援。
title 為元件定義 title 屬性。預設值為 Reddit
通用屬性 此元素包含擴充至 AMP 元件的通用屬性

驗證

請參閱 AMP 驗證器規格中的 amp-reddit 規則

需要更多協助嗎?

您已閱讀本文件許多次,但仍未涵蓋所有問題?也許其他人也有同感:請在 Stack Overflow 上與他們交流。

前往 Stack Overflow
發現錯誤或缺少功能?

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

前往 GitHub