I’m storing JSON data from my Pocket API into my Jekyll _data directory. Pocket’s API uses a “=>” format, which seems to make Jekyll barf when recompiling.
I’m using a simple regex to convert all “=>” tags to ": ", which passes Jekyll’s JSON parser. However the original seems to be getting through.
data file contents:
{“status”: 1, “complete”: 1, “list”: {“3386186011”: {“item_id”: “3386186011”, “resolved_id”: “3386126548”, “given_url”: “No, we don’t use Kubernetes”,
as rendered in a draft post (using {{records[“list”]}}):
{“3386186011”=>{“item_id”=>“3386186011”, “resolved_id”=>“3386126548”, “given_url”=>“No, we don’t use Kubernetes”,
It looks like I’m pointing to the correct data file. Am I missing something about Jekyll preprocessing?
If you are sure you are pointing to the correct file, you might want to delete the contents of the _site folder and rebuild your Jekyll site to see if you get different results. Not seeing the contents of the JSON file or the code that renders the page it is hard to tell what might be going on.
I am having the same issue described by the OP and I tried the solution proposed in your post but the issue keeps present itself… Is there something else I should try?
no need, I solved the issue just today.
I was using the wrong liquid filter: {{ foo | json }} instead of {{ foo | jsonify }} .
Now the json parses correctly.
Sorry for the noise!