Include_relative inside layout file doesnt render markdown to html

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?

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

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

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

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