Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📖 Update docs for amp-gist to indicate height does not have to be obtained up front #17738

Merged
merged 1 commit into from
Sep 1, 2018

Conversation

westonruter
Copy link
Member

In the docs for amp-gist for its height attribute, there is a note:

Note: You must find the height of the gist by inspecting it with your browser (e.g., Chrome Developer Tools).

This turns out not to be true. If the exact height is not specified, the gist will get resized to be the proper dimensions once the gist loads:

// Triggered by window.context.requestResize() inside the iframe.
listenFor(iframe, 'embed-size', data => {
this./*OK*/changeHeight(data['height']);
}, /* opt_is3P */true);

So I believe the height should be marked as recommended, or that it is the initial height of the gist.

@cathyxz cathyxz merged commit f1ac3ee into ampproject:master Sep 1, 2018
@cathyxz
Copy link
Contributor

cathyxz commented Sep 1, 2018

Thank you @westonruter !

jeherve pushed a commit to Automattic/jetpack that referenced this pull request Sep 26, 2018
…10053)

#### Changes proposed in this Pull Request:

* Return `amp-gist` from a `gist` shortcode or oEmbed when in an AMP response.

#### Testing instructions:

1. Install the [AMP plugin](https://github.com/Automattic/amp-wp).
2. Add a `gist` shortcode or gist oEmbed URL to a post. Then view that post in AMP.
3. View the AMP version of the post.

Example content:

```html
oEmbed: Full gist:

https://gist.github.com/sebastianbenz/1d449dee039202d8b7464f1131eae449

oEmbed: Linking to a file via in a Gist:

https://gist.github.com/sebastianbenz/1d449dee039202d8b7464f1131eae449#file-sw-html

oEmbed: Linking to file without username in URL.

https://gist.github.com/1d449dee039202d8b7464f1131eae449#file-sw-html

Example from WordPress.com docs:

[gist https://gist.github.com/2314628 /]

Second example from WordPress.com docs:

[gist]2314628[/gist]
```

Originally proposed in ampproject/amp-wp#375

See also ampproject/amphtml#17738 for details on the `amp-gist`'s `height` attribute.

#### Proposed changelog entry for your changes:

* Add Gist support for AMP responses.
Enriqe pushed a commit to Enriqe/amphtml that referenced this pull request Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants