{
"title": "Title",
"description" : "# Heading 1 \n * List item \n * List item"
}
and I want if possible to output JSON format for categories pages
[
{{ range $index, $e := .Pages }}
{{ $title := .Title }}
{{ $description := .Params.description }}
{{ if $index }}, {{ end }}
{
"title": "{{ $title }}",
"description" : "{{ $description }}"
}
{{ end }}
]
Unfortunately the final JSON comes with “Error: Parse error on line …” the reason is the $description.
How I can convert this value to be parsed to JSON correctly?