我在和jekyll一起写博客。我尝试在docker上使用jekyll,得到以下错误:
Error: A Liquid tag in the excerpt of _posts/2019-05-21-jekyll-caching.md couldn't be parsed.
Error: could not read file /srv/jekyll/_posts/2019-05-21-jekyll-caching.md: undefined method `ancestors' for nil:NilClass在错误文件中,我编写了一个小技巧来使liquid语句成为html。以下是博客的内容:
(...)liquid是由Shopify在html之上以{{" {% include head.html "}}%}格式编写的模板语言。
使用{{"{% include head.html"}}%}看起来像是一个错误,但是直到在docker上运行了jekyll,这个错误才发生。我在谷歌上搜索,我找不到错误的原因,并询问了stackoverflow。请注意,虽然出现错误,但服务器运行正常。
如果您需要了解更多信息来回答,请让我知道。
发布于 2019-07-17 08:36:15
解决这个问题出奇的容易。上述液体门的包装如下所示:
{% raw %}
{% include head.html %}
{% endraw %}当然,你可以像这样包装几个液体块:
{% raw %}
{% if %}
{% include head.html %}
{% endif %}
{% endraw %}https://stackoverflow.com/questions/57040107
复制相似问题