Skip to content

Commit

Permalink
Merge pull request #27583 from guardian/opengraph-interactives
Browse files Browse the repository at this point in the history
Set opengraph properties on interactive type
  • Loading branch information
philmcmahon authored Nov 6, 2024
2 parents 3d52dd2 + 3781164 commit f72e79d
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 f72e79d

Please sign in to comment.