David Silva Smith
David Silva Smith

Reputation: 11706

Can I use includes in my Jekyll Front Matter?

Can I use includes in my Jekyll Front matter?

It would be useful for setting variables like this:

---
excerpt: Bitcoin Bulls customers pay in USD but those dollars are all converted to bitcoin.
image: {% include first-post-image-src.html }
---

That way I could reference the post.image in other places.

When I try the code above I get this error:

Error reading file /Users/smithd98/apps/bitcoinbulls.net/_posts/2014-09-08-We-Convert-All-Dollars-to-Bitcoin.md: (<unknown>): found character that cannot start any token while scanning for the next token at line 3 column 9 

Upvotes: 1

Views: 86

Answers (1)

David Jacquel
David Jacquel

Reputation: 52799

The answer is No. You cannot put Liquid tags in Yaml Front Matter.

  • they create parsing errors (you can try to quote them),
  • and mainly, they will never be parsed as Yaml Front Matter is supposed to store plain variables.

Upvotes: 2

Related Questions