How to markdownify a liquid include (cause it's fun)
Refs:
- https://github.com/jekyll/jekyll/issues/1303
- http://stackoverflow.com/questions/27771508/showing-markdown-content-in-a-div
To include a markdown file in Jekyll rendering, you would use something similar to:
{% capture myinclude %}{% include amarkdownfile.md %}{% endcapture %}
{{ myinclude | markdownify } }
Troubleshooting
During jekyll serving:
- Error: wrong argument type nil (expected String)
- resolve by ensuring the "{ % capture my_include" is not hyphenated. Statements like "{ % capture my-include" will fail like this. hyphenated capture var names not supported.
- Front-matter of the included markdown file is not required. If you include it, the front matter will be rendered as markdown. (not interpretted json)
blog comments powered by Disqus