Important: this documentation is not applicable to your currently selected format email!
amp-reddit
Description
Displays a Reddit comment or post embed.
Required Scripts
<script async custom-element="amp-reddit" src="https://cdn.ampproject.org/v0/amp-reddit-0.1.js"></script>
Supported Layouts
Examples
Use the amp-reddit
component to embed a Reddit post or comment.
Example: Embedding a Reddit post
<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>
Example: Embedding a Reddit comment
<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>
Attributes
data-embedtype (required) | The type of embed, either post or comment . |
data-src (required) | The permamlink uri for the post or comment. |
data-uuid | The provided UUID for the comment embed. Supported when data-embedtype is comment . |
data-embedcreated | The datetime string for the comment embed. Supported when data-embedtype is comment . |
data-embedparent | The datetime string for the comment embed. Supported when data-embedtype is comment . |
data-embedlive | Indicates whether the embedded comment should update if the original comment is updated. Supported when data-embedtype is comment . |
title | Define a title attribute for the component. The default is Reddit . |
common attributes | This element includes common attributes extended to AMP components. |
Validation
See amp-reddit rules in the AMP validator specification.
도움이 더 필요하신가요?
이 문서를 수십 번 읽었음에도 여전히 궁금한 점이 남아 있나요? 다른 개발자들도 같은 심정일지 모릅니다. Stack Overflow에서 소통해 보세요.
Stack Overflow로 이동 버그나 누락된 기능을 발견하셨나요?AMP 프로젝트는 여러분의 참여와 기여를 적극 환영합니다! 오픈 소스 커뮤니티를 통해 지속적으로 활동해 주셔도 좋지만 관심 있는 주제에 한 번만 기여하셔도 큰 도움이 됩니다.
GitHub로 이동하기