Fix validation error in publisher Structured Data.

This commit is contained in:
Dillon Kearns 2020-04-11 09:32:59 -07:00
parent 7b8aa4cb1a
commit 7e83160c73
2 changed files with 13 additions and 3 deletions

View File

@ -550,7 +550,7 @@ head currentPath metadata =
{ title = meta.title
, description = meta.description
, author = meta.author.name
, publisher = "elm-pages blog"
, publisher = StructuredData.person { name = "Dillon Kearns" }
, url = canonicalSiteUrl ++ "/" ++ PagePath.toString currentPath
, imageUrl = canonicalSiteUrl ++ "/" ++ ImagePath.toString meta.image
, datePublished = Date.toIsoString meta.published

View File

@ -22,6 +22,16 @@ softwareSourceCode info =
]
{-| <https://schema.org/Person>
-}
person : { name : String } -> Encode.Value
person info =
Encode.object
[ ( "@type", Encode.string "Person" )
, ( "name", Encode.string info.name )
]
{-| <https://schema.org/ComputerLanguage>
-}
computerLanguage : { url : String, name : String, imageUrl : String, identifier : String } -> Encode.Value
@ -51,7 +61,7 @@ article :
{ title : String
, description : String
, author : String
, publisher : String
, publisher : Encode.Value
, url : String
, imageUrl : String
, datePublished : String
@ -66,7 +76,7 @@ article info =
, ( "description", Encode.string info.description )
, ( "image", Encode.string info.imageUrl )
, ( "author", Encode.string info.author )
, ( "publisher", Encode.string info.publisher )
, ( "publisher", info.publisher )
, ( "url", Encode.string info.url )
, ( "datePublished", Encode.string info.datePublished )
, ( "mainEntityOfPage", info.mainEntityOfPage )