Issues adding github gist to my blog(using Google blogger)

后端 未结 7 859
故里飘歌
故里飘歌 2021-02-09 17:26

I\'m trying to add a gist to my blog to see how it works and use it to share some code related blogs going forward.

I\'ve followed the steps mentioned form this blog, bu

7条回答
  •  长发绾君心
    2021-02-09 17:54

    The blog post you mention explains everything clearly and it's all you have to do. I'll describe what I did:

    1. I copied the into a widget that is dynamically loaded into each blog page (posts, pages, everything). This will not work, because, as being said, include the following code at the end of each of your blog posts. This means you have to include it separately in al your posts. Yes, I don't like it as well, but the blog entries are loaded dynamically, so you have to load gists after the original blog entry is loaded.

    2. Put the

      Loading ....
      just where you would put original github gist code. For example - this is a gist I wanted to display on my post. This is the original code: . The gistID is 6235219. So, instead, I put
      Loading ....
      . And in the end of the post, I put the javascript source from point 1.

    This blog post is an example that it works fine.

提交回复
热议问题