【问题标题】:Ruby Jekyll - Octopress cannot Rake generate with URIRuby Jekyll - Octopress 无法使用 URI 生成 Rake
【发布时间】:2015-07-14 07:23:00
【问题描述】:

看来我对 Jekyll 有严重的问题。到目前为止没有任何效果,我仍然有

杰基尔 2.5.3 |错误:错误的 URI(不是 URI?): https://gist.githubusercontent.com/

我已经将它包含在我的源代码中:

Gist 方法:下面的示例代码可用于从 Gist 中提取代码 来自 Github

 {% gist gist_id [filename] %}

我想在我的博客中将这些作为示例进行说明,但遇到了 rake generate 问题,给出了上述错误。我已经完成了我的研究,并且在关闭了其他错误(不关闭块引用等)之后,这是我自己无法弄清楚的。

【问题讨论】:

  • 无法使用 octopress 在本地复制。你在 github 上有一些代码吗?
  • 没有。由于我无法 rake generate,我无法推送本地所做的更改,但我认为可能导致问题的可疑行是这一行:{% gist gist_id [filename] %} 我附上了一个屏幕供您参考:http://s4.postimg.org/pg6bcn5x9/havehad.png

标签: ruby octopress


【解决方案1】:

您正在使用带有占位符的文档字符串。

{% gist gist_id [filename] %}

此字符串由 Octopress Gist 插件解析,并且由于生成的 url (https://gist.githubusercontent.com/raw/id/[filename]) 具有错误的模式,因此会引发错误。

如果您想在帖子中打印此文档,您可以这样做。

{% highlight liquid %}
{% raw %}{% gist gist_id [filename] %}{% endraw %}
{% endhighlight %}

有关 Octopress 的 Gist 标签的更多信息,请参阅:http://octopress.org/docs/plugins/gist-tag/

【讨论】:

  • 这是一个非常准确的答案。通过一些调整(使用 pygments),我可以让它们在突出显示模式下工作。 {% highlight liquid %} {% raw %} {% gist gist_id [filename] %} {% endraw %} {% endhighlight %}
  • 我回答你的问题了吗?
  • 所以也许你可以批准它。谢谢。
  • 我刚刚批准了它。非常感谢您的帮助。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-11-26
  • 2013-04-06
  • 2012-10-11
  • 2012-06-19
  • 2013-08-02
  • 2015-07-14
  • 1970-01-01
相关资源
最近更新 更多