Liquid Tags Not Working in Markdown Files in Non-Post Subdirectory

Liquid tags like {{ site.baseurl }} not rendering in non-post subdirectory (called “momentum_content”) markdown. Non-rendered, raw Liquid tags shown here:

Liquid tags seem to work fine in markdown within _posts.

jekll build --verbose says it’s rendering the files:

Rendering: momentum_content/
Pre-Render Hooks: momentum_content/
Rendering Liquid: momentum_content/
Rendering Markup: momentum_content/
Rendering Layout: momentum_content/

… but a little differently than it renders posts, where “Rendering Liquid” is not listed:

Rendering: _posts/2018-04-28-rebuilding.markdown
Pre-Render Hooks: _posts/2018-04-28-rebuilding.markdown
Rendering Markup: _posts/2018-04-28-rebuilding.markdown
Rendering Layout: _posts/2018-04-28-rebuilding.markdown
Layout source: site

Have tried using collections, but makes no difference:

output: true

Full source at:

I believe the problem is your post.html layout and this line. You don’t need page.content nor do you need the Markdownify filter… just plain ole {{ content }} will do the trick.

You’re essentially applying it twice which is why you’re getting the unrendered Liquid. I just cloned your repo and replaced {{page.content | markdownify }} with {{ content }} and the Liquid tags in your file output as expected.

What about in a context where I’m rendering the content of a different page?

That depends on how you’re pulling in content from a different page. Usually that’s done via a for loop on an object. In that case you prepend content with whatever you named the items in the loop to e.g. foo.content


{% for foo in site.posts %}
  {{ foo.title }}
  {{ foo.content }}
{% endfor %}

Right, but in that context, specifically in an html include, I’ve had the problem before that the markdown didn’t render and it required a | markdownify… which now seems to have escaped the liquid tags :pensive: It seems I’m stretching Jekyll to its limit having an include inside page content inside an include inside page content :laughing:

Includes are a different beast. They depend on the file extension used as well. If you have a .html include it’s going to need the markdownify filter. But if it’s .md then I believe it will parse the text as Markdown without the filter.

Though that’s likely not what you want either since you have HTML in the include and you’ll find all sorts of goofiness changing the include’s extension to .md since indents will be interpreted as code blocks and your HTML markup will get mangled.