Markdown 如何在Jekyll页面中语法突出显示Jekyll标记

Markdown 如何在Jekyll页面中语法突出显示Jekyll标记,markdown,jekyll,liquid,Markdown,Jekyll,Liquid,我正试图用kramdown解析的Markdown来写一篇基于Jekyll的帖子,讲述我是如何在Jekyll的液体模板引擎中取得一些成就的。然而,当生成页面时,Jekyll似乎会混淆我打算呈现的实际标记,还是应该显示为代码 因此,如何使以下代码段在我的文章中显示为突出显示的代码部分 {% for post in paginator.posts %} <div class="author">{{ post.date | date_to_string }}</div>

我正试图用kramdown解析的Markdown来写一篇基于Jekyll的帖子,讲述我是如何在Jekyll的液体模板引擎中取得一些成就的。然而,当生成页面时,Jekyll似乎会混淆我打算呈现的实际标记,还是应该显示为代码

因此,如何使以下代码段在我的文章中显示为突出显示的代码部分

{% for post in paginator.posts %}
   <div class="author">{{ post.date | date_to_string }}</div>
   <h3><a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></h3>
   <div class="content">
       {{ post.content | split:"<!--break-->" | first }}
   </div>
   <b><a href="{{ BASE_PATH }}{{ post.url }}">continue reading >></a></b>
   <hr/>
{% endfor %}
{%用于paginator.posts%}
{{post.date | date_to_string}
{{post.content | split:| first}

{%endfor%}
假设您有液体lexer:

{% highlight liquid %}
{% raw %}
{% for post in paginator.posts %}
   <div class="author">{{ post.date | date_to_string }}</div>
   <h3><a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></h3>
   <div class="content">
       {{ post.content | split:"<!--break-->" | first }}
   </div>
   <b><a href="{{ BASE_PATH }}{{ post.url }}">continue reading >></a></b>
   <hr/>
{% endfor %}
{% endraw %}
{% endhighlight %}
{%highlight liquid%}
{%raw%}
{paginator.posts%中的post为%s}
{{post.date | date_to_string}
{{post.content | split:| first}

{%endfor%} {%endraw%} {%endhighlight%}
假设您有液体lexer:

{% highlight liquid %}
{% raw %}
{% for post in paginator.posts %}
   <div class="author">{{ post.date | date_to_string }}</div>
   <h3><a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></h3>
   <div class="content">
       {{ post.content | split:"<!--break-->" | first }}
   </div>
   <b><a href="{{ BASE_PATH }}{{ post.url }}">continue reading >></a></b>
   <hr/>
{% endfor %}
{% endraw %}
{% endhighlight %}
{%highlight liquid%}
{%raw%}
{paginator.posts%中的post为%s}
{{post.date | date_to_string}
{{post.content | split:| first}

{%endfor%} {%endraw%} {%endhighlight%}
谢谢,这很有效。虽然我不得不使用
{%highlight html%}
,但它不会将
liquid
识别为有效的突出显示语言,请尝试使用“django”,因为它更接近liquid。谢谢,这很有效。虽然我不得不使用
{%highlight html%}
,但它不会将
liquid
识别为有效的突出显示语言,而是尝试使用“django”,因为它更接近liquid。