Hello with ghost 2.27 we got concat and i have a question.
Can we use {{concat}} with rand numbers ? Like 0,12 (Generate from 0 to 12 rand number) or Apple, Banana, Orange (Select random one)
Concat will literally just concatenate everything supplied to it with an optional separator
e.g. {{concat "hello" "world" separator="_"}}
=> hello_world
{{concat "he" "llo"}}
=> hello
Ghost themes deliberately do not have any concept of random or dynamic data, because the templates are static, generated server side, cached on the server and designed to be heavily cached between the server and the user too.
Soo, if you used random data, it’d never really be random.
The correct approach is to use client-side JS to inject dynamic or random elements into the page.
Thanks for reply.
I can inject custom js file in my header file and get random int or str this works.
The problem is I’m trying to get random banner links in my amp.hbs file but amp not support custom javascript or random generator yet.
After ghost update I see the concat integrate then i think maybe it works now…