Closed xplosionmind closed 5 months ago
Hi @xplosionmind
Thank you for bringing this to my attention. Unfortunately after further investigation and testing, this functionality is only available in Nunjucks templates 😢
I updated the eleventy-plugin-metagen docs to reflect this. The problem with Liquid templates is that their shortcode syntax doesn't use name=value
pair arguments and due to the variability of arguments that metagen
supports, it wouldn't be feasible to change the metagen logic for Liquid shortcodes as there are 44 supported arguments which don't follow any particular ordering.
That being said, Liquid shortcodes cannot handle {% user firstName or "fallback", lastName or "fallback" %}
template logic like a shortocde within a Nunjucks template could so that is a quick answer to your original question about the syntax error. If you want to have this template logic functionality, you will have to use the metagen plugin in a Nunjucks template or use the short-hand Liquid shortcode syntax like {% metagen metadata %}
where the metadata
object handles any conditional logic or specific data requirements from frontmatter or some other data source like a global data file etc.
Let me know if this clears things up and I'm happy to answer any follow-up questions if needed.
Hello!
I am testing this plugin inside a Liquid template, but I get a syntax error.
This is what I wrote in the template:
This is the error log:
I am using Eleventy v2.0.1 (Liquid 10.14.0), with eleventy-plugin-metagen v1.8.3.