Skip to content

Commit cfa84e2

Browse files
committed
Merge remote-tracking branch 'origin/feature/seo' into feature/seo
2 parents 4835a95 + 6bb5d4c commit cfa84e2

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/Dtos/ContentDto.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ public function getSeo(?string $locale = null)
222222
$result = $seo->get($locale);
223223

224224
// Using fallback locale
225-
if (! $result &&
226-
($fallbackLocale = $this->getFallbackLocale()) &&
225+
if (! $result &&
226+
($fallbackLocale = $this->getFallbackLocale()) &&
227227
($fallbackSeo = $seo->get($fallbackLocale))
228228
) {
229229
$result = $fallbackSeo;

src/Dtos/SeoDto.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ public function __toString(): string
246246
if ($this->noFollow) {
247247
$robotsContent[] = 'nofollow';
248248
}
249-
if (!empty($robotsContent)) {
250-
$html .= "<meta name=\"robots\" content=\"" . implode(', ', $robotsContent) . "\">\n";
249+
if (! empty($robotsContent)) {
250+
$html .= '<meta name="robots" content="' . implode(', ', $robotsContent) . "\">\n";
251251
}
252252

253253
return $html;
@@ -266,11 +266,12 @@ protected function transformImage($value)
266266
if (filter_var($value, FILTER_VALIDATE_URL)) {
267267
return $value;
268268
}
269-
269+
270270
// If not, check if it is a relative URL (e.g., "/storage/images/example.jpg")
271271
if (str_starts_with($value, '/')) {
272272
// Assuming the base URL is defined in your configuration
273273
$baseUrl = config('app.url', 'http://localhost');
274+
274275
return rtrim($baseUrl, '/') . $value;
275276
}
276277

@@ -289,7 +290,7 @@ protected function transformImage($value)
289290
} catch (\Throwable $th) {
290291
//
291292
}
292-
293+
293294
return null;
294295
}
295296

0 commit comments

Comments
 (0)