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

Jetpack: [gist] shortcodes #375

Closed
inetbiz opened this issue Apr 25, 2016 · 3 comments
Closed

Jetpack: [gist] shortcodes #375

inetbiz opened this issue Apr 25, 2016 · 3 comments
Labels
Enhancement New feature or improvement of an existing one P2 Low priority

Comments

@inetbiz
Copy link

inetbiz commented Apr 25, 2016

I'm asking for a feature that converts [gist]xxxxxxx[/gist] shortcodes to links.

@mjangda mjangda added Enhancement New feature or improvement of an existing one P2 Low priority labels Aug 18, 2016
@mjangda mjangda changed the title jetpack-helper.php - Add function to deal with [gist] shortcodes Jetpack: [gist] shortcodes Aug 18, 2016
@westonruter
Copy link
Member

See list of core embeds being targeted here: #806 (comment)

Support for oEmbeds Gists are added by Jetpack: https://github.com/Automattic/jetpack/blob/b4ee9f55cb3819ffb4ce519c668130282e1a3544/modules/shortcodes/gist.php#L9-L10

There is an amp-gist component which can be used here.

The best move here would probably to open a PR to Jetpack to add a new AMP_Base_Embed_Handler subclass for AMP_Gist_Embed_Handler which can do similarly to what can be seen in the Tweet embed support: https://github.com/Automattic/amp-wp/blob/develop/includes/embeds/class-amp-twitter-embed.php

@westonruter
Copy link
Member

This should rather be added to the Jetpack plugin itself. See #1021.

@westonruter
Copy link
Member

westonruter commented Aug 27, 2018

PR opened: Automattic/jetpack#10053

jeherve pushed a commit to Automattic/jetpack that referenced this issue 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or improvement of an existing one P2 Low priority
Projects
None yet
Development

No branches or pull requests

3 participants