Need help fixing my schema.html file

hello im facing a problem in my shema.html file when i test my website in google structured data i get this error cancelJSON-LD Missing ':' after object member name.

you can find my shema.html file here https://github.com/SamHamou/Arafeed/blob/master/themes/Feed/layouts/partials/site_schema.html

Can you show us an example of the actual schema generated by that code?

you can check it here : https://search.google.com/structured-data/testing-tool#url=https%3A%2F%2Ftahmil.netlify.app%2Fposts%2Fblog%2Fdifference-between-websockets-and-restapi%2F

Wrap the values in quotation marks.

i did that the problem still exist
https://search.google.com/test/rich-results?utm_campaign=sdtt&utm_medium=url&id=gyZoEY8IQir7gOwI-TapCQ

Line 2:2806. Uh, weird. The <script> block simply ends with "image", not even the : is rendered.

You also need to wrap the image URLs in quotation marks.

https://github.com/SamHamou/Arafeed/blob/master/themes/Feed/layouts/partials/site_schema.html#L59

Change this:

"image": {{ if .Params.images }}[{{ range $i, $e := .Params.images }}{{ if $i }}, {{ end }}{{ $e | absURL }}{{ end }}]{{ else}}{{.Site.Params.logo | absURL }}{{ end }},

To this:

"image": {{ if .Params.images }}[{{ range $i, $e := .Params.images }}{{ if $i }}, {{ end }}"{{ $e | absURL }}"{{ end }}]{{ else}}"{{.Site.Params.logo | absURL }}"{{ end }},
2 Likes

thank you this has fixed the problem

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.