Backslash added to my JSON Structured Data


I switched recnetly to Hugo 55, after long use of 48 version.

I have problems with the generated JSON code, back slashes are added to URL, so it makes structured data control failed.

Using the same code in HTML regions, shows the url without escape back slash

Someone have any idea?
@context”: “”,
@type”: “Article”,
“url”: “{{ .Permalink | safeHTML}}”,
“headline”: " {{ .Params.Title }}",
“image”: “{{ .Params.banner }}”,
“keywords”: “{{ .Site.Params.defaultKeywords }}”,
“datePublished”: “{{ }}”,
“articleSection”: “Lifestyle”,
“creator”: “HTS”,
“author”: “HTS”,
“articleBody”: “{{ .Summary }}”,
“mainEntityOfPage”: “True”,
“contactPoint”: [{
@type”: “ContactPoint”,
“telephone”: “{{ | safeHTML}}”,
“contactType”: “reservations”



"url": {{ .Permalink | jsonify | safeJS }},

Hi, i tried this, the issue persists

Try removing the " marks. There is another thread about a similar issue here:

In short, it seems that since the code is already inside a <script> tag, Hugo outputs it accordingly.

I think that the solution is to use such code

{{ dict “url” .Permalink }},

But how to do is with all a huge data . Used like that it print :



1 Like