You’re welcome! I actually do use a recursive include to build my nested tags directory. Each tag has a parent in the frontmatter, and the recursive include crawls it like a tree
Hello, I believe I have seen this before, but haven’t commented on / left a feedback at the time. Glad I got another opportunity.
Overall, it is a good collection of snippets but I really fail to understand the magic / logic in Make a map. {{ mykeys[2] }} => {{ myvalues[2] }} ??? Sure, this code would render into new_key => new_value, but how is that in any way part of a new data structure my_map that would allow one to subsequently use my_map["new_key"] to get new_value rendered?
On the same note, its sad that variables defined in an include “leaks” into outer scope. Though not exactly your fault, but now we cannot have this “leak” fixed to maintain compatibility.
One other tip (not exactly a recipe) you could popularize is that Whitespace is beautiful and improves readability. What I mean by this is that {% include alpha.html foo="lorem" bar='ipsum' %} is equivalent to the following:
{% include alpha.html foo = "lorem" bar = 'ipsum' %}
{% include alpha.html
foo = "lorem"
bar = 'ipsum' %}
The very next section shows how using a simple include Two, unsorted arrays are not the most efficient implementation of a map, but it is a implementation.
Of course, sorting the arrays by the key would be more efficient, but I’ll leave that one as an exercise to the reader