2
votes

I want to build something like this:

{% my_liquid_template "some parameter" %}

However I want it to also accept this:

{% my_liquid_template "{{ site.url }}/feed.rss" %}

The first one is easy. The second one just does not parse {{ site.url }}. How can I do that?

This is not about writing a liquid template plugin. I now how to do that. However I would like to pass the liquid template "{{ site.url }}/feed.rss" as a parameter.

I do not want to append the site.url in the liquid template code, because this will break {% my_liquid_template "some parameter" %}.

Even this does not work

{% my_liquid_template site.url %}
1

1 Answers

0
votes

You can't nest tags in Liquid markup.

You could assign the variable then use it further down, for example:

{% assign my_site = site.url %}
{{ my_liquid_template my_site}}