Skip to content

Commit e9f2f9c

Browse files
Update layout to conditionally render page title (#183)
The <title> tag is now only rendered if the SEO meta title is the default or empty, preventing duplicate or unnecessary titles when a custom SEO title is set. This improves SEO handling and avoids conflicts with dynamic title management.
1 parent f0beed1 commit e9f2f9c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

resources/views/components/layout.blade.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,14 @@
2727
content="{{ csrf_token() }}"
2828
/>
2929

30-
<title>NativePHP{{ isset($title) ? ' | ' . $title : '' }}</title>
30+
@php
31+
$seoTitle = SEOMeta::getTitle();
32+
$defaultSeoTitle = config('seotools.meta.defaults.title');
33+
@endphp
34+
35+
@if($seoTitle === $defaultSeoTitle || empty($seoTitle))
36+
<title>NativePHP{{ isset($title) ? ' | ' . $title : '' }}</title>
37+
@endif
3138

3239
{{-- Favicon --}}
3340
<link

0 commit comments

Comments
 (0)