bod*_*tva 6 embed blogs gist github code-editor
我正在尝试为我的博客添加一个要点,看看它是如何工作的,并用它来分享一些与代码相关的博客.
我已按照此博客中提到的步骤进行操作,但我无法使其工作.我不知道我错过了什么,关于我可能遗失的任何指示都会非常感激.
我的博客相关代码的HTML编辑器如下所示: -
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Hi<br />
<br />
test<br />
<br />
<br />
<div class="gistLoad" data-id="4132084" id="gist-4132084">
Loading ....</div>
<br />
<br />
<br />
<br />
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; word-wrap: break-word;"></pre>
</div>
<script src="https://raw.github.com/moski/gist-Blogger/master/public/gistLoader.js" type="text/javascript"></script> </div>
Run Code Online (Sandbox Code Playgroud)
谢谢.
更新 (包括,更改上面的代码)
我发现有一件事令人困惑,我为什么要在博客的"撰写"部分粘贴div标签,这是HTML代码,所以我把它移到了博客的HTML编辑器部分.最初让我感到困惑的是博客中提到它:
现在要包含任何要点模板,只需在博客文章的任何位置添加以下内容即可.
但无论如何,现在,我只能"加载"..,错误仍然存在..
这是为我正确完成的代码.我必须确保在div中我复制代码,当你真正在Github上看到一个真正的要点(比如说,这个要点)时,它是' 嵌入要点 '的一部分.
另外,我犯的另一个错误是在我的代码中,JS并不完全在帖子之外(如果你仔细观察(我的坏),它实际上在最后一个div内).无论如何,一切都很好,结果很好:).所以这里的代码对我有用 -
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Hi<br />
<br />
test<br />
<br />
<br />
<div class="gistLoad" data-id="4132084" id="gist-4132084">
<script src="https://gist.github.com/boddhisattva/4132084.js"></script>
In case you want to see how I was able to embed the gist in my blog, you can have a look
at the stackoverflow question that I <a href="http://stackoverflow.com/questions/18788724/issues-adding-github-gist-to-my-blogusing-google-blogger/21355714#21355714">posted here</a> on the same when I had initially faced issues to get this to work for me.
Credits to the original <a href="http://blog.moski.me/2012/01/gist-with-bloggers-dynamic-views.html">blogger's post</a>.
</div>
<br />
<br />
<br />
<br />
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; word-wrap: break-word;"></pre>
</div>
</div>
<script src="https://raw.github.com/moski/gist-Blogger/master/public/gistLoader.js" type="text/javascript"></script>
Run Code Online (Sandbox Code Playgroud)
这是使用上述代码的实际博客链接.
干杯.. :)
| 归档时间: |
|
| 查看次数: |
3057 次 |
| 最近记录: |