【问题标题】:Jekyll: how to not interpret jekyll / ruby lines in a code snippet (rouge)?Jekyll:如何不解释代码片段(胭脂)中的 jekyll / ruby​​ 行?
【发布时间】:2017-12-26 23:46:29
【问题描述】:

我在 Jekyll 帖子中有这段代码:

{% highlight html linenos %}
<!doctype html>
<html class="no-js" lang="en" dir="ltr">

    {% include head.html %}

    <body>
    [...]
    </body>

</html>
{% endhighlight %}

例如,我希望在渲染 sn-p 时不解释行 {% include head.html %}

【问题讨论】:

    标签: html ruby jekyll


    【解决方案1】:

    包围代码
     {% raw %}
    

    还有

    {% endraw %}
    

    如果您使用的语言包含花括号,您将 可能需要在代码周围放置 {% raw %} 和 {% endraw %} 标签。

    更多信息请访问https://jekyllrb.com/docs/templates/

    【讨论】:

    • 有道理没看到那个!谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-16
    • 1970-01-01
    • 2023-03-30
    相关资源
    最近更新 更多