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


#1

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

Liquid tags seem to work fine in markdown within _posts.

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

Rendering: momentum_content/test.md
Pre-Render Hooks: momentum_content/test.md
Rendering Liquid: momentum_content/test.md
Rendering Markup: momentum_content/test.md
Rendering Layout: momentum_content/test.md

… 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:

collections:
momentum_content:
output: true

Full source at: https://github.com/kimardenmiller/Momentum


#2

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 test.md file output as expected.