简体   繁体   中英

Jekyll: Running jekyll on docker

I'm running a blog with jekyll. I tried using jekyll on the docker and I got the following error:

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

In the error file, I wrote a little trick to make the liquid statement html. Below is the content of the blog:

(...) liquid is a template language written by Shopify on top of html in {{" {% include head.html "}}%} format.

It looks like an error using {{"{% include head.html"}}%} , but this error did not occur until jekyll was run on the docker. I searched on google and I could not find the cause of the error and asked stackoverflow. Note that the server runs fine though there is an error.

Please let me know if there's more information you need to know to answer.

It was surprisingly easy to solve. The above liquid door was wrapped as shown below:

{% raw %}
  {% include head.html %}
{% endraw %}

Of course, you can wrap several liquid blocks like this:

{% raw %}
  {% if %}
    {% include head.html %}
  {% endif %}
{% endraw %}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM