Skip to content

Instantly share code, notes, and snippets.

@sarvsav
Forked from hanxue/embed-gist-in-blogger.js
Created January 23, 2022 08:38
Show Gist options
  • Save sarvsav/a97419f4ad8595616d837d59ec20fe74 to your computer and use it in GitHub Desktop.
Save sarvsav/a97419f4ad8595616d837d59ec20fe74 to your computer and use it in GitHub Desktop.
Embed Gists in Blogger
At the end of your Blogger post , using HTML editor, append this
<script src="https://raw.github.com/moski/gist-Blogger/master/public/gistLoader.js" type="text/javascript"></script>
In the content of your blog post, simply add this:
<div class="gistLoad" data-id="8488564" id="gist-8488564">Loading https://gist.github.com/8488564....</div>
Note: adding the URL is useful because when the javascript does not work, readers can copy and paste the URL themselves.
If you need to specify a single file within a Gist, use the data-file attribute
<div class="gistLoad" data-id="4982341" data-file="gistfile2.cs" id="gist-4982341">Loading https://gist.github.com/4982341....</div><br />
Source: https://github.com/moski/gist-Blogger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment