我刚刚升级了一个基于jekyll的站点以使用Jekyll 3.3.1,它开始在这些方面窒息:
{% raw %}
<textarea class="codemirror" data-lang="html">
<html>
<head>
<title>{{$form_name}}</title>
{{$required_resources}}
</head>
<body></textarea>
{% endraw %}
它抛出的警告是:
Liquid Warning: Liquid syntax error (line 12): Unexpected character $
in "{{$required_resources}}" in
modules/form_builder/customization/anatomy/header.html
为什么会发生这种情况?我认为raw / endraw是专门用于嵌入任何内容而不是由Jekyll解析的?
我担心这可能会导致问题。
谢谢!
答案 0 :(得分:1)
非常奇怪。 {% raw %}
标记应该防止标记之间的Liquid被处理。看起来Liquid可能正在读取标签之间的内容,但没有处理它。
这似乎是一个液体错误。我鼓励您在Liquid repo中打开一个问题,以便维护人员能够确定是否需要修复它。
答案 1 :(得分:0)
您可以尝试缩小{% raw %}
和{% endraw %}
的范围,就像这样。
<textarea class="codemirror" data-lang="html">
<html>
<head>
<title>{{$form_name}}</title>
{% raw %}{{$required_resources}}{% endraw %}
</head>
<body></textarea>
我尝试修复帖子的Liquid语法错误时想出了这个想法。
{% raw %}
{% quote author:"Free Software Foundation" title:"Introduction To the Command Line" %}
Hint: Do not try to learn all shortcuts at once! The human brain isn't made for that kind of stuff, so you will forget almost all of them. Rather, we advise you to learn the 4--5 shortcuts that you find most useful and use them regularly --- learning by doing. Later, you can come back to this chapter to pick up more shortcuts. You will soon find yourself whirling across the command line.
{% endquote %}
{% endraw %}
错误讯息:
Liquid Exception: undefined method `getConverterImpl' for
#<Jekyll::Site:0x007fffc791f798> in /home/user/vincenttam.github.io
/_posts/2014-01-08-testing-online-code-syntax-highlighters-for-blogs-
5-embedding-makefiles-to-a-web-page.markdown
jekyll 3.3.1 | Error: undefined method `getConverterImpl' for
#<Jekyll::Site:0x007fffc791f798>
如果我将{% quote %}
和{% endquote %}
与{% raw %}
和{% endraw %}
包围在一起,那么将不会被杰基尔解析。
{% raw %}
{% quote author:"Free Software Foundation" title:"Introduction To the Command Line" %}
{% endraw %}
Hint: Do not try to learn all shortcuts at once! The human brain isn't made for that kind of stuff, so you will forget almost all of them. Rather, we advise you to learn the 4--5 shortcuts that you find most useful and use them regularly --- learning by doing. Later, you can come back to this chapter to pick up more shortcuts. You will soon find yourself whirling across the command line.
{% raw %}
{% endquote %}
{% endraw %}