My website is almost ported to #11ty , but there's one issue left that I can't resolve:
In #zola , I have a shortcode for embedding mastodon feed of specified account. I figured I'd use liquid's {% render %} for it in 11ty instead of a shortcode, as it supports arguments and is basically what #zola shortcode is.
Inside a zola shortcode, you can acces a variable called "nth", which will increment if you use the same shortcode multiple times on one page. It's value will be "1" in the first shortcode, "2" in the second and so on.
The library for embedding mastodon post requires a container with an id. Using this variable, I can just use
<div id="masto-feed-{{ nth }}"></div>
and I have every feed have it's own unique id.
How do I do that in 11ty? I don't necessarily need this numbering, although I imagine it being useful for other things as well. I just need every shortcode on one page to have it's own unique id. I have a feeling that it's probably something simple I missed in the documentation, but I haven't been able to find a solution anyway.
#webdev #ssg #eleventy