gpt4 book ai didi

github - 在我的博客中添加github gist的问题(使用Google博客)

转载 作者:行者123 更新时间:2023-12-04 13:51:11 25 4
gpt4 key购买 nike

我正在尝试在自己的gist中添加一个blog,以了解其工作原理,并使用它来共享一些与代码相关的博客。

我已经按照this blog所述的步骤进行了操作,但是无法正常工作。我不知道我缺少什么,任何关于我可能缺少的东西的指针都将不胜感激。

我的博客相关代码的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>

谢谢。

更新 (包括更改上面的代码)

我发现一件事有些困惑,为什么我实际上应该在博客的 “撰写” 部分中粘贴div标签,毕竟这是HTML代码,所以我将其移到了博客的HTML编辑器部分。最初让我感到困惑的是当它在博客中被提及时:

Now to include any gist template just add the following anywhere in your blog post.



但是无论如何,现在,我只收到“正在加载” ..,错误仍然存​​在。

最佳答案

这是为我正确完成的代码。我必须确保在div 内复制,然后在 Github 上实际看到某人的真实要旨(例如this gist)时,将其作为“嵌入要点”的一部分。

另外,我犯的另一个错误是我的代码,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>

这是使用上述代码的实际 blog链接。

干杯.. :)

关于github - 在我的博客中添加github gist的问题(使用Google博客),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18788724/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com