Search code examples
jekyllgithub-pages

GitHub flavored markdown with an {% include ... %} code block


I have a GitHub pages site running Jekyll. I want to write a code block in a blog post, with the following content:

{% include file.html %}

Unfortunately Jekyll is reading this literally and including the referenced files content, i.e. the content of file.html. How do I explicitly tell Jekyll that this line should not be executed?


Solution

  • Use the raw tag.

    {% raw %}{% include file.html %}{% endraw %}