fix invalid json-ld image object alt property

JSON-LD ImageObject alt property is not recongized as a valid property. Therefore, logically replace the alt property with description without breaking other metadata and then delete it.
This commit is contained in:
Adam 2024-06-18 19:42:36 -06:00
parent f449b1af64
commit 7335533ce9
No known key found for this signature in database
GPG Key ID: C477357A238747AC
1 changed files with 9 additions and 0 deletions

View File

@ -59,6 +59,15 @@ module Jekyll
hash = page_drop.image.to_h
hash["url"] = hash.delete("path")
hash["@type"] = "imageObject"
if hash["alt"] && !hash["description"]
hash["description"] = hash["alt"]
end
if hash["alt"]
hash.delete("alt")
end
hash
end