【问题标题】:The tag `img` is not a recognized Liquid tag GitHub pages with Octopress标签 `img` 不是带有 Octopress 的公认 Liquid 标签 GitHub 页面
【发布时间】:2015-02-14 02:58:15
【问题描述】:

我创建了一个包含一些图像标签的帖子。这些图像显示在本地rake preview。 这是帖子中的代码

{% img left /images/books_1.png 220 300 %} {% img left /images/books_2.png 220 300 %} {% img /images/books_3.png 220 300 %} 但是当我推送到 github 页面时。 Git hub 向我发送构建失败错误说。 The tag img in 'source/_posts/2014-11-29-pages.markdown/#excerpt' is not a recognized Liquid tag。 我是否需要添加任何插件才能在 github 页面中使用 img 标签?

【问题讨论】:

  • 使用rake generaterake deploy。请记住,HTML 是一种发布格式,而 Markdown 是一种写作格式。您需要生成您的 HTML。

标签: jekyll octopress github-pages


【解决方案1】:

最近当我更新我的博客并突然开始出现页面构建错误时,这让我感到很痛苦。原来 GitHub Pages 最近改成了automatically build any content included in the repo

失败的原因是 GH 页面(直接)不支持 Octopress —— GH 页面支持 relatively small number of plugins,而 Octopress 不是其中之一。

我的解决方案是在博客的根目录中创建并提交一个名为“.nojekyll”的文件(如链接中所述)。

明确一点——当您使用 Octopress 时,您会在本地为博客生成所有 html,并将生成的 html 推送到 GitHub Pages。因此,GH 不需要对 markdown 文件进行任何渲染——这一切都在您的本地机器上完成,在 GH 看到它之前。

但是,Octopress 也会将您的博客源提交到 repo(特别是“rake deploy”命令)——并且随着对 GH Pages 的更改,GH 会尝试(并且失败)呈现 markdown 文件。 .nojekyll 文件将其关闭,一切正常。

【讨论】:

    【解决方案2】:

    您无法在 Github 页面 (see allowed plugins here) 上运行 octopress 插件。

    您必须使用“rake generate && rake deploy”命令 (see Octopress documentation here)

    【讨论】:

      猜你喜欢
      • 2019-06-27
      • 1970-01-01
      • 2013-07-24
      • 1970-01-01
      • 1970-01-01
      • 2018-03-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多