How can I get value when the key contains a minus sign?
I try that {{ file-1 }}, {{ "file-1" }} and {{ ["file-1"] }} but it doesn't works. I am getting value NaN.
I don't want to change the key name, can anyone guide me on how to do it using nunjucks.
See here for a related discussion and workarounds. This is in the context of eleventy but the general idea should be applicable to any nunjucks project.
Example of sample.json:
{ "file-1": "my_file_1" }
How can I get value when the key contains a minus sign?
I try that {{ file-1 }}, {{ "file-1" }} and {{ ["file-1"] }} but it doesn't works. I am getting value
NaN
. I don't want to change the key name, can anyone guide me on how to do it using nunjucks.