My website is almost ported to , but there's one issue left that I can't resolve:

In , 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 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.

:boost_requested:

0

If you have a fediverse account, you can quote this note from your own instance. Search https://f.cz/users/stepan/statuses/115686073195672375 on your instance and quote it. (Note that quoting is not supported in Mastodon.)