GitHub embedded support for AMP

Posted in: Newspaper
Post count: 623

Hello team,

Is there a possible way to show GitHub embedded code on Newspaper AMP?

Post count: 20685

Hi,

You could try and embed a gist in AMP like this
https://www.ampproject.org/docs/reference/components/amp-gist

Post count: 623

Hi @simion

I have tried this. To get this work you need to add the script to the site then you must embed GitHub code with amp tags this doesn’t display embedded code on the normal page.

And there is no dedicated AMP editor to modify code just for AMP.

Even making preformatted text responsive will help.

I tried this –
.pre {
white-space: pre-wrap;
}

This auto adjusts the preformatted text on the small display.

Do you have a better solution than this?

Post count: 20685

Indeed you would first need to insert the script and then only the gists will appear
https://www.screencast.com/t/uuceJdoS
That would be the only solution I found online. Normal gist embeds in posts do not appear in AMP pages.

Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.