amp-twitter
Introduction
Use amp-twitter
to embed tweets into your AMP HTML files.
Setup
Don't forget to import the twitter component
<script async custom-element="amp-twitter" src="https://cdn.ampproject.org/v0/amp-twitter-0.1.js"></script>
Basic usage
Tweets are embedded via id. Twitter does not currently provide an API that yields fixed aspect ratio Tweet embeds.
You may need to manually tweak the provided width and height.
<amp-twitter width="375" height="472" layout="responsive" data-tweetid="638793490521001985">
</amp-twitter>
Hidden cards
Options for the Tweet appearance can be set using data-
attributes, for example data-cards="hidden"
deactivates Twitter cards.
<amp-twitter width="390" height="330" layout="responsive" data-tweetid="585110598171631616" data-cards="hidden">
</amp-twitter>
Twitter moment embed
Use data-momentid
to include a twitter moment.
<amp-twitter width="390" height="330" layout="responsive" data-momentid="1018806709412876288">
</amp-twitter>
If the explanations on this page don't cover all of your questions feel free to reach out to other AMP users to discuss your exact use case.
Go to Stack Overflow An unexplained feature?The AMP project strongly encourages your participation and contributions! We hope you'll become an ongoing participant in our open source community but we also welcome one-off contributions for the issues you're particularly passionate about.
Edit sample on GitHub-
Written by @sebastianbenz