How to prevent jekyll code running within markdown code blocks

后端 未结 1 1835
遥遥无期
遥遥无期 2021-01-25 06:28

I was trying to add the following codes in a markdown code block on a Jekyll blog. However, the code within braces {% %} cannot be displayed.

{% for post in site         


        
相关标签:
1条回答
  • 2021-01-25 06:39

    You can use the raw tag.

    {% raw %}
    {% for post in site.categories.[page.category] %}
    {% if year != nyear %}
    <p>{{ year }}</p>
    {% endif %}
    ...
    {% endraw %}
    

    This will render the liquid code as is.

    0 讨论(0)
提交回复
热议问题