[Bug] Unparsable json in headers
Probably a minor issue, but Google is complaining that https://jamulus.io/kb/2020/03/28/Server-Rpi.html and https://jamulus.io/it/kb/2022/08/04/Translating-po-files.html have "Error parsing an array value: missing a comma or closing bracket in an array declaration."
{
"@context":"https://schema.org",
"@type":"BlogPosting",
"headline": "Install Jamulus Server on a Raspberry Pi",
"publisher": {
"@type": "Person",
"name": "fredsiva",
}, <--- highlights this as the error location
"author": {
"@type": "Person",
"name": "fredsiva",
},
Looking at _layouts/post.html I'm not sure how to fix it though - does it need re-generating in some way?
"name": {
"key": "value",
}
has a trailing comma after "value", which will confuse most parsers. The template should be written to only add a comma before the second and subsequent entry, rather than after every entry. (Some templating schemas have explicit support for this need.)
Or for this kind of if block:
"publisher": {
"@type": "Person",
"name": "{% if site.data.authors[page.author].name %}{{ site.data.authors[page.author].name }}{% else %}{{ page.author }}{% endif %}",
{% if site.data.authors[page.author].url %}"url": "{{ site.data.authors[page.author].url }}"{% endif %}
},
do this:
"publisher": {
"@type": "Person",
"name": "{% if site.data.authors[page.author].name %}{{ site.data.authors[page.author].name }}{% else %}{{ page.author }}{% endif %}"{% if site.data.authors[page.author].url %},
"url": "{{ site.data.authors[page.author].url }}"{% endif %}
},
so that the {% if starts before the , that separates the conditional element from the previous content.
https://github.com/jamulussoftware/jamuluswebsite/pull/1051 just might work.
I get this:
{
"@context":"https://schema.org",
"@type":"BlogPosting",
"headline": "Install Jamulus Server on a Raspberry Pi",
"publisher": {
"@type": "Person",
"name": "fredsiva"
},
"author": {
"@type": "Person",
"name": "fredsiva"
},
"datePublished": "2020-03-28T00:00:00-05:00"
}
http://jamuluswebsite.drealm.info/kb/2020/03/28/Server-Rpi.html
(I might contend - and I might have said before - that "publisher" should be "Jamulus Development Team", or some other representation of the jamulus.io site owners.)