Yes, the variable is correct… all works good with this… <%- post.title %<%- post.slug %>
and also just one of them… <%- post.title %> standalone or <%- post.slug %> standalone.
But when I put them together with a / in between that is needed for the URL, then its wild-guessing it seems…
It means at some point, post.slug is being coerced into a number. Are you using any math operators by mistake? Make sure you’ve got the backticks around your string exactly as I have them in the post above.
At this point, it’s the blind leading the blind since I don’t know EJS very well and I don’t have access to your project to test this. Let’s get hacky.
Is outputting that array directly into the template: effectively, it’s running toString on the array, so it’ll just try to print that as a string. If I test this, like
If I add join() in data-slug, then the comment section disappears completely in my blogpost (the whole commenting system is just blank).
This data-slug="<%= [post.title,post.slug] %>" atleast “works” in that I can use the commenting system fully.
But the only problem is that the commenting system then outputs… domain.com/title,post
I think I cannot do what is needed within data-slug, but perhaps there is solution here in this line? const post_url = config.get('page_url').replace('%SLUG%', event.slug)+'#comment-'+event.id;