alanorth / hugo-theme-bootstrap4-blog

A blogging-centric Bootstrap v4 theme for the Hugo static site generator.
Other
204 stars 132 forks source link

Fixed formatting of ld-json keywords list on list.html default #140

Closed jeremyrcampb closed 3 years ago

jeremyrcampb commented 3 years ago

Fixed formatting of 'keywords' metadata. Was being reported by Google Search Console as "Unparsable structured data Parsing error: Missing ',' or '}'".

Output, before (from example site):

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Blog",
  "headline": "Picturing Jordan",
  "url" : "https://picturingjordan.com/",
  "author": {
    "@type": "Person",
    "name": "Alan Orth"
  },
  "dateModified": "2020-04-20T15:55:20+03:00",
  "keywords": "architecture,""design,""food,""islam,""nature,""travel,""ajloun,""amman,""aqaba,""art,""baklava,""bedouin,""byzantine,""camping,""church,""community,""dead-sea,""desert,""driving,""eid,""fabric,""gadara,""graffiti,""greek,""jerash,""jerusalem,""kanafeh,""mosque,""noise,""oasis,""olives,""painting,""pella,""petra,""red-sea,""roman,""sheep,""umm-qays,""wadi-rum,""wetland,""whatsapp,""yemen,",
  "description":"Sharing Jordan with the world — one picture at a time."
}
</script>

Output, before (from my site):

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Blog",
  "headline": "SaveOn.cloud",
  "url" : "https://saveon.cloud/",
  "author": {
    "@type": "Person",
    "name":  null
  },
  "dateModified": "2020-10-12T12:59:24-05:00",
  "keywords": "analyze,""attribute,""bigquery,""budget,""clean-up,""concept,""concepts,""engineering,""finance,""foundation,""intro,""manage,""mindset,""optimize,""practices,""responsibility,",
  "description":"Manage your Cloud Infrastructure Spend"
}
</script>

Output, after (from my site):

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Blog",
  "headline": "SaveOn.cloud",
  "url" : "http://localhost:1313/",
  "author": {
    "@type": "Person",
    "name":  null
  },
  "dateModified": "2020-10-12T12:59:24-05:00",
  "keywords": "analyze, attribute, bigquery, budget, clean-up, concepts, engineering, finance, foundation, intro, manage, mindset, optimize, practices, responsibility",
  "description":"Manage your Cloud Infrastructure Spend"
}
</script>

Ref: https://schema.org/keywords

alanorth commented 3 years ago

Great catch! Yes this looks strange how it was before... I don't remember it always looking like that. Thank you.