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
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.