How to Embed GitHub Code in Medium?

İkbal Arslan
Feb 4, 2021

I think GitHub code looks great in medium posts. What’s the easiest way to embed GitHub code to medium post?

First of all, to create a GitHub gist, go to your gists from the upper right corner of the GitHub page.

On gists page, a new page is reached from the plus sign at the top right and the code to be shared is created from here.

How to create Gist?

You can create your gists as secret or public. Public gists are visible to everyone and secret gists are hidden by search engines however visible to anyone you give the URL to.

After creating the gist, copy the URL shown in the gif. Paste the copied URL into your medium blog page and don’t forget to press “Enter” afterwards.

Paste URL and click enter

Here is how our GitHub code looks like:

Hope this helps.

Thank you for reading!

--

--