I'm trying to descend a recursive data-structure and recursively render the same template [1] Forget the recursive part, I'm unable to pass local variables to an included template. I've tried the following, and nothing works:
{% include "includes/toc.html" with tocItems = page.toc %}
{% with tocItems = page.toc %}
{% include "includes/toc.html" %}
{% endwith %}
{% scope %}
{% set tocItems = page.toc %}
{% include "includes/toc.html" %}
{% endscope %}
[1] I'm trying to generate a page's TOC -- which is why the recursion
I'm trying to descend a recursive data-structure and recursively render the same template [1] Forget the recursive part, I'm unable to pass local variables to an included template. I've tried the following, and nothing works:
[1] I'm trying to generate a page's TOC -- which is why the recursion