Skip to content

Latest commit

 

History

History
79 lines (61 loc) · 2.84 KB

amp-instagram.md

File metadata and controls

79 lines (61 loc) · 2.84 KB

amp-instagram

Description Displays an instagram embed.
Availability Stable
Required Script <script async custom-element="amp-instagram" src="https://cdn.ampproject.org/v0/amp-instagram-0.1.js"></script>
Supported Layouts FILL, FIXED, FIXED_HEIGHT, FLEX_ITEM, NODISPLAY, RESPONSIVE
Examples amp-instagram.html
instagram.amp.html

Behavior

The width and height attributes are special for the instagram embed. These should be the actual width and height of the instagram image. The system automatically adds space for the "chrome" that instagram adds around the image.

Many instagrams are square. When you set layout="responsive" any value where width and height are the same will work.

Example:

<amp-instagram
    data-shortcode="fBwFP"
    width="400"
    height="400"
    layout="responsive">
</amp-instagram>

If the instagram is not square you will need to enter the actual dimensions of the image.

When using non-responsive layout you will need to account for the extra space added for the "instagram chrome" around the image. This is currently 48px above and below the image and 8px on the sides.

Attributes

data-shortcode

The instagram data-shortcode found in every instagram photo URL.

E.g. in https://instagram.com/p/fBwFP fBwFP is the data-shortcode.

Validation

See amp-instagram rules in the AMP validator specification.