【问题标题】:Highlight Liquid with Rouge & JekyllRouge & Jekyll 高光液体
【发布时间】:2019-01-31 19:20:05
【问题描述】:

我试图突出显示一块液体和 html 代码,但它似乎不起作用。所有其他语言都可以正常工作。

我使用的是 Jekyll v3.8.5,而 gemfile.lock 中的 Rouge 版本是 v3.3.0

我一直将代码块包装在{% highlight xxx %} - {% endhighlight %} 中,其他语言没有任何问题。

以下是我目前使用的

{% highlight liqiud %}

{% if project.tags.size > 0 %}
    {% for tag in project.tags %}
        <span class="project-tags text-lower text-monospace">{{ tag }}</span>
    {% endfor %}
{% endif %}

{% endhighlight %}

下面的块突出显示没有任何问题,它似乎是任何有液体的东西都不起作用。

{% highlight css %}

.project-tags, .post-tags {
    font-size: 0.875rem;
    color: #0366d6;
    background-color: #f1f8ff;
    border-radius: 3px;
    display: inline-block;
    margin: 0 .5em .5em 0;
    padding: .3em .9em;
    white-space: nowrap;
}

{% endhighlight %}

对于液体块,我只得到一个空代码块。这些是我的_config.yml 设置:

kramdown:
  syntax_highlighter: rouge
  syntax_highlighter_opts:
    css_class: 'highlight'
    span:
      line_numbers: false
    block:
      line_numbers: true

我不会说谎我有点难过。

【问题讨论】:

    标签: jekyll liquid rouge


    【解决方案1】:
    {% highlight liqiud %}
    

    会不会是你拼错了liquid

    【讨论】:

    • 正确的拼写没有用……但我把它改成了 ```liquid 然后就可以了。感谢您指出我缺乏拼写技巧哈哈。
    猜你喜欢
    • 2016-05-04
    • 1970-01-01
    • 1970-01-01
    • 2018-11-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-28
    • 2020-07-08
    相关资源
    最近更新 更多