Skip to content

Commit bd2b4da

Browse files
authored
Fix JsonLd default url (#261)
* Fix JsonLd default url The docs state that when providing `null` as the default JsonLd URL `URL::current()` is used. But actually `URL::full()` was used.
1 parent 2190dc4 commit bd2b4da

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/SEOTools/JsonLd.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,13 @@ public function convertToArray(): array
117117
}
118118

119119
if ($this->url !== false) {
120-
$generated['url'] = $this->url ?? app('url')->full();
120+
if ($this->url === null || $this->url === 'full') {
121+
$generated['url'] = app('url')->full();
122+
} elseif ($this->url === 'current') {
123+
$generated['url'] = app('url')->current();
124+
} else {
125+
$generated['url'] = $this->url;
126+
}
121127
}
122128

123129
if (!empty($this->images)) {

src/resources/config/seotools.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
'defaults' => [
6161
'title' => 'Over 9000 Thousand!', // set false to total remove
6262
'description' => 'For those who helped create the Genki Dama', // set false to total remove
63-
'url' => false, // Set null for using Url::current(), set false to total remove
63+
'url' => false, // Set to null or 'full' to use Url::full(), set to 'current' to use Url::current(), set false to total remove
6464
'type' => 'WebPage',
6565
'images' => [],
6666
],

0 commit comments

Comments
 (0)