Skip to content

Commit

Permalink
Update schemaorg.go
Browse files Browse the repository at this point in the history
  • Loading branch information
mfenner committed May 1, 2024
1 parent b35e1e8 commit 97cc930
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions schemaorg/schemaorg.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,17 @@ func Convert(data commonmeta.Data) (SchemaOrg, error) {

if len(data.References) > 0 {
for _, reference := range data.References {
t := "CreativeWork"
if reference.Type == "JournalArticle" {
t = "ScholarlyArticle"
if reference.ID != "" {
t := "CreativeWork"
if reference.Type == "JournalArticle" {
t = "ScholarlyArticle"
}
schemaorg.Citation = append(schemaorg.Citation, Citation{
ID: reference.ID,
Type: t,
Name: reference.Title,
})
}
schemaorg.Citation = append(schemaorg.Citation, Citation{
ID: reference.ID,
Type: t,
Name: reference.Title,
})
}
}

Expand Down

0 comments on commit 97cc930

Please sign in to comment.