Skip to content

Commit 296d880

Browse files
ben221199Gummibeer
authored andcommitted
allow og:image instead of og:image:url
1 parent d0d7383 commit 296d880

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

src/Type.php

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@ public function alternateLocale(string $locale)
7777
*/
7878
public function image($image)
7979
{
80-
$this->addStructuredProperty(
81-
$image instanceof Image
82-
? $image
83-
: Image::make($image)
84-
);
80+
if($image instanceof Image) {
81+
$this->addStructuredProperty($image);
82+
83+
return $this;
84+
}
85+
86+
$this->addProperty('og', 'image', $image);
8587

8688
return $this;
8789
}
@@ -92,11 +94,13 @@ public function image($image)
9294
*/
9395
public function video($video)
9496
{
95-
$this->addStructuredProperty(
96-
$video instanceof Video
97-
? $video
98-
: Video::make($video)
99-
);
97+
if($video instanceof Video) {
98+
$this->addStructuredProperty($video);
99+
100+
return $this;
101+
}
102+
103+
$this->addProperty('og', 'video', $video);
100104

101105
return $this;
102106
}
@@ -107,11 +111,13 @@ public function video($video)
107111
*/
108112
public function audio($audio)
109113
{
110-
$this->addStructuredProperty(
111-
$audio instanceof Audio
112-
? $audio
113-
: Audio::make($audio)
114-
);
114+
if($audio instanceof Audio) {
115+
$this->addStructuredProperty($audio);
116+
117+
return $this;
118+
}
119+
120+
$this->addProperty('og', 'audio', $audio);
115121

116122
return $this;
117123
}

0 commit comments

Comments
 (0)