Include_relative inside layout file doesnt render markdown to html


#1

I have this page:

mypage/
└── index.md 
└── doc.md

when I add {% include_relative doc.md %} inside index.md it is rendered to html perfectly.

However when I add {% include_relative doc.md %} inside the layout file of index.md, also the content of doc.md is being taken, however its not rendered to html.

Can someone explain why? and is there a solution?


#2

have you tried the markdownify filter? I think it would be {% include_relative doc.md | markdownify %}


#3

My guess is since last layouts are .html they don’t process Markdown.


#4

When I try to do this, I’m getting an error:

Liquid Exception: Invalid syntax for include tag: | markdownify Valid syntax: {% include_relative file.ext param='value' param2='value' %} in /_layouts/video.html

#5

It seems It’s one of the long waiting feature request that hasn’t been implemented yet.

https://github.com/jekyll/jekyll/issues/1303