Skip to content

Commit

Permalink
mod_ginger_rdf: refactor license to display only when rights are sele…
Browse files Browse the repository at this point in the history
…cted (#742)
  • Loading branch information
DorienD authored Oct 29, 2024
1 parent 5a20bd3 commit 9f2680b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions modules/mod_ginger_rdf/support/schema_org.erl
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,18 @@ image_object(Id, Context) ->
#triple{
predicate = rdf_property:rdf(<<"type">>),
object = rdf_property:schema(<<"ImageObject">>)
},
#triple{
predicate = rdf_property:schema(<<"license">>),
object = m_rsc:p(Id, license, Context)
}
]
++ (case m_creative_commons:url_for(m_rsc:p(Id, rights, Context)) of
undefined ->
[];
Url ->
[#triple{
predicate = rdf_property:schema(<<"license">>),
object = Url
}]
end
)
++ m_rdf_export:translations_to_rdf(
rdf_property:schema(<<"name">>), m_rsc:p(Id, title, Context),
Context
Expand Down

0 comments on commit 9f2680b

Please sign in to comment.