I used to put shortcodes under templates/shortcodes, but putting component definitions there doesn’t work. I tried templates/components but still doesn’t work. It’s not mentioned at all in documentation and I can’t find any examples using 0.23!
You can put them anywhere, they are discovered automatically. For the docs of Zola for example I’m putting them in zola/docs/templates/components.html at master · getzola/zola · GitHub but they could really any scattered across any files if you want.
Yes, they are scattered in 8 template files on my converted site, and in 7 templates files in my local copy of the apollo theme I use.
They are scattered because I quickly auto-migrated my site to tera2 with AI, so they stayed in their previous place when they were macros or shortcodes, but I will surely now refactor them in a more logical way.
PS: AI is superbly efficient to work with opinionated systems such as Zola, it would have struggled with Hugo sites for instance. You can see how I did it at Migration of this site to the new Zola Tera2