How to Embed Gist on website

933
gist

Gist is an easy method to share snippets or excerpts of data with others. A gist can be a string of code, a bash script or some other small piece of data. Every gist is a Git repository, which means that it can be forked and cloned. If you are signed in to GitHub when you create a gist, the gist will be associated with your account and you will see it in your list of gists when you navigate to your gist home page.

You can create two kinds of gists: public and secret. Create a public gist if you’re ready to share your ideas with the world or a secret gist if you’re not. Secret gists don’t show up in Discover and are not searchable. Secret gists aren’t private. If you send the URL of a secret gist to a friend , they’ll be able to see it. However, if someone you don’t know discovers the URL, they’ll also be able to see your gist. If you need to keep your code away from prying eyes, you may want to create a private repository instead.

Create a Gist

Follow the below steps to create a new gist.

  • Sign in to GitHub.
  • Navigate to your gist home page.
  • Type an optional description and name for your gist
  • Type the text of your gist into the gist text box.
  • Optionally, to create a public gist, click , then click Create public gist.
  • Click Create secret Gist or Create public gist.

Embed Gist on Website

After successful gist creation, we will embed our gist on our website. I hope you have already created gist. Navigate to your gist URL page.

https://gist.github.com/vijayrana99/5c48e12877251975d085f83f64952510

You can easily add Gist to your WordPress Posts with the help of Gutenberg Blocks. Gutenberg editor comes with a block called – Custom HTML. For this, simply type Back Slash (/) and type html, Custom Html will show. Select it

Just add Custom HTML block and paste the embed code you copied from gist as like below inside that block.

That’s it, you will have your Gist added to your WordPress Posts.

Check out the example of gist imbedded post about How to display Google Reviews on website.

Read More Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.