Add Code Snippet To Blog Post Using Github Gist

Monday, October 17, 2016 No Comments

This post may contain referral links. For more info, please read my disclosure policy.

github

A Gist is a snippet of code hosted by Github. it has all the benefits of a Github repository, but provides them to you in a most easy way. Public Gists are free to create and store on Github. They are likewise super easy.
You can create a new Gist, add, modify, and delete files and code entirely in the browser. You don't need to install or download anything.

last time I wrote about how you can add code snippets to your blogger blog posts using syntaxhighlighter. Today, I will be exposing to you how github works for blogger and other blogging platforms when it comes to adding code snippets.

Below are the steps
  1. Sign up with github if you haven't, then Log in to site.
  2. Click the Gist link at the top of the screen or visit gist.github.com
  3. Fill out the file name
  4. Enter your supposed code
  5. Click Create Public Gist
Note: The syntax highlighting auto- detects based on the extension of the file name that you enter, so be sure you add the appropriate level of detail. Now that you have created your gist, you need to embed it.

github

Once you create your Gist, you will land on a page which displays your code.
Copy the embed link and paste the script tag on to your website.

and that's all.
make sure your paste the script tag in the html view of your post editor...
To edit any code you've written, go to your github gists and edit.

Blog Archive

Contact / Address

Mr Sunday Joseph's Compound,
Off Goodnews street, Azikoro,
Yenagoa Bayelsa State
Nigeria.
Zipcode: 569101

Reach Us on
+2348122329659
or
Contact@blogtrovert.com

Blog Owned and managed By:
Joseph Onome.