Skip to content

Commit

Permalink
Set opengraph properties on interactive type
Browse files Browse the repository at this point in the history
  • Loading branch information
philmcmahon committed Nov 6, 2024
1 parent 3d52dd2 commit f97a00b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions common/app/model/content.scala
Original file line number Diff line number Diff line change
Expand Up @@ -995,11 +995,21 @@ object Interactive {
val fields = content.fields
val section = content.metadata.sectionId

val opengraphProperties: Map[String, String] = Map(
("og:type", "article"),
("article:published_time", content.trail.webPublicationDate.toString()),
("article:modified_time", content.fields.lastModified.toString()),
("article:tag", content.tags.keywords.map(_.name).mkString(",")),
("article:section", content.trail.sectionName),
("article:publisher", "https://www.facebook.com/theguardian"),
)

val metadata = content.metadata.copy(
contentType = Some(contentType),
adUnitSuffix = section + "/" + contentType.name.toLowerCase,
twitterPropertiesOverrides = Map("twitter:title" -> fields.linkText),
contentWithSlimHeader = InteractiveHeaderSwitch.isSwitchedOff,
opengraphPropertiesOverrides = opengraphProperties
)
val contentOverrides = content.copy(
metadata = metadata,
Expand Down

0 comments on commit f97a00b

Please sign in to comment.