【问题标题】:Liquid Exception in atom.xmlatom.xml 中的液体异常
【发布时间】:2012-06-04 15:16:08
【问题描述】:

我正在使用 Octopress 写博客。但是原来它不支持Tex,所以我在网上寻求了一些指导。最后,我没有使用Tex&markdown。

更糟糕的是,出现以下问题:

lo@lo:~/blog/octopress$ rake generate
## Generating Site with Jekyll
unchanged sass/screen.scss
unchanged sass/syntax/syntax.scss
unchanged sass/bootstrap/responsive.scss
unchanged sass/bootstrap/bootstrap.scss
Configuration from /home/lo/blog/octopress/_config.yml
Building site: source -> public
Liquid Exception: Variable '{{' was not properly terminated with regexp: /\}\}/  in    atom.xml
Liquid Exception: Variable '{{' was not properly terminated with regexp: /\}\}/  in atom.xml
Liquid Exception: Variable '{{' was not properly terminated with regexp: /\}\}/  in atom.xml
Successfully generated site: source -> public
lo@lo:~/blog/octopress$`

现在我不知道如何解决它。

我尝试diff/octopress/octopress.bk 中的所有文件。
最后,我发现我在*.markdown.中使用了错误的语法

我写了\{\{\{ \}\}\},这导致了问题。 现在我解决了。

【问题讨论】:

    标签: ruby regex liquid octopress


    【解决方案1】:

    似乎您的 atom.xml 文件已更改。您可以在包含您的网站的文件夹的根目录中找到它。你需要找到的是不匹配的{{ tag }}。很可能缺少一个括号,例如 {{ 仅用一个 } 关闭它。

    下面是默认的 atom.xml 文件,您可以将其用作示例:

    ---
    layout: nil
    ---
    <?xml version="1.0" encoding="utf-8"?>
    <feed xmlns="http://www.w3.org/2005/Atom">
    
     <title>Your Title</title>
     <link href="http://www.example.com/atom.xml" rel="self"/>
     <link href="http://www.example.com/"/>
     <updated>{{ site.time | date_to_xmlschema }}</updated>
     <id>http://www.example.com/</id>
     <author>
       <name>Your Name/name>
       <email>Your Email</email>
     </author>
    
     {% for post in site.posts %}
     <entry>
       <title>{{ post.title }}</title>
       <link href="http://www.example.com{{ post.url }}"/>
       <updated>{{ post.date | date_to_xmlschema }}</updated>
       <id>http://www.example.com{{ post.id }}</id>
       <content type="html">{{ post.content | xml_escape }}</content>
     </entry>
     {% endfor %}
    
    </feed>
    

    【讨论】:

    • 我尝试diff /octopress/octopress.bk 中的所有文件。最后,我发现我在 *.markdown 中使用了错误的语法。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-22
    • 2011-06-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多