amp-reddit
簡介
amp-reddit
元件允許將 reddit 貼文和留言嵌入到 AMP 檔案中。
設定
匯入 amp-reddit
元件
<script async custom-element="amp-reddit" src="https://cdn.ampproject.org/v0/amp-reddit-0.1.js"></script>
嵌入貼文
嵌入單一貼文。
<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&ref_source=embed">
</amp-reddit>
嵌入留言
嵌入單一留言。
<amp-reddit layout="responsive" width="400" height="400" data-embedtype="comment" data-src="https://www.reddit.com/r/me_irl/comments/52rmir/me_irl/d7n3soo/">
</amp-reddit>
父留言
透過指定 data-embedparent="true"
嵌入父留言。
<amp-reddit layout="responsive" width="400" height="400" data-embedtype="comment" data-src="https://www.reddit.com/r/me_irl/comments/52rmir/me_irl/d7n3soo/" data-embedparent="true">
</amp-reddit>
自動更新留言
當原始留言更新時,透過指定 data-embedlive="true"
更新留言
<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-embedlive="true">
</amp-reddit>
需要更多說明嗎?
如果此頁面的說明未能解答您的所有問題,請隨時聯繫其他 AMP 使用者,討論您的具體應用情境。
前往 Stack Overflow 未說明的特色功能?AMP 專案非常鼓勵您的參與和貢獻!我們希望您能成為我們開源社群的長期參與者,同時我們也歡迎您針對您特別關注的問題做出一次性的貢獻。
在 GitHub 上編輯範例-
由 @nainar 撰寫