# Include\_relative inside layout file doesnt render markdown to html

**URL:** <https://talk.jekyllrb.com/t/include-relative-inside-layout-file-doesnt-render-markdown-to-html/1546>\
**Category:** Help\
**Created:** [March 1, 2018, 12:21am UTC](https://talk.jekyllrb.com/t/include-relative-inside-layout-file-doesnt-render-markdown-to-html/1546 "2018-03-01T00:21:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hnaseri](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/hnaseri/32/831_2.png) [@hnaseri](https://talk.jekyllrb.com/u/hnaseri)\
**Post date:** [March 1, 2018, 12:21am UTC](https://talk.jekyllrb.com/t/include-relative-inside-layout-file-doesnt-render-markdown-to-html/1546/1 "2018-03-01T00:21:00Z")

</div>

I have this page:

```auto
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?

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [March 1, 2018, 12:58am UTC](https://talk.jekyllrb.com/t/include-relative-inside-layout-file-doesnt-render-markdown-to-html/1546/2 "2018-03-01T00:58:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mmistakes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/mmistakes/32/2169_2.png) [@mmistakes](https://talk.jekyllrb.com/u/mmistakes)\
**Post date:** [March 1, 2018, 1:18am UTC](https://talk.jekyllrb.com/t/include-relative-inside-layout-file-doesnt-render-markdown-to-html/1546/3 "2018-03-01T01:18:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hnaseri](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/hnaseri/32/831_2.png) [@hnaseri](https://talk.jekyllrb.com/u/hnaseri)\
**Post date:** [March 1, 2018, 5:52am UTC](https://talk.jekyllrb.com/t/include-relative-inside-layout-file-doesnt-render-markdown-to-html/1546/4 "2018-03-01T05:52:49Z")

</div>

> [@rdyar](#):
>
> have you tried the markdownify filter?

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

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

```

---

<div class="post-metadata">

**Author:** ![hnaseri](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/hnaseri/32/831_2.png) [@hnaseri](https://talk.jekyllrb.com/u/hnaseri)\
**Post date:** [March 1, 2018, 9:28am UTC](https://talk.jekyllrb.com/t/include-relative-inside-layout-file-doesnt-render-markdown-to-html/1546/5 "2018-03-01T09:28:14Z")

</div>

> [@mmistakes](#):
>
> My guess is since last layouts are .html they don’t process Markdown.

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

> <https://github.com/jekyll/jekyll/issues/1303>
>
> Is it intended that when you add \`{% include a\_markdown\_file.md %}\` from within …an HTML page, that it doesn't markdownify the include? The documentation seems to include that it should.
> 
> http://jekyllrb.com/docs/templates/#includes
