diff --git a/resources/views/_snippets/layout/head.blade.php b/resources/views/_snippets/layout/head.blade.php
index b97da0e5e..8e2f1273e 100644
--- a/resources/views/_snippets/layout/head.blade.php
+++ b/resources/views/_snippets/layout/head.blade.php
@@ -1,14 +1,27 @@
-
-
-@php
- $full_title = (isset($page_title) ? $page_title . ' | ' : '') . \App\Enum\Design::MAIN_TITLE;
-@endphp
-
-
{{ $full_title }}
+@isset ($metaDescription)
+
+
+@else
+
+@endisset
+
+
+@isset ($metaTitle)
+ {{ $metaTitle }}
+
+
+@else
+ @php
+ $full_title = (isset($page_title) ? $page_title . ' | ' : '') . \App\Enum\Design::MAIN_TITLE;
+ @endphp
+ {{ $full_title }}
+
+
+@endisset
@@ -22,9 +35,6 @@
-
-
-
diff --git a/src/Controller/Blog/BlogController.php b/src/Controller/Blog/BlogController.php
index 56ffc5997..62470e229 100644
--- a/src/Controller/Blog/BlogController.php
+++ b/src/Controller/Blog/BlogController.php
@@ -15,6 +15,8 @@ public function __invoke(PostRepository $postRepository): View
return \view('blog/blog', [
'page_title' => 'Learn about Rector, Upgrades and Planning',
'posts' => $postRepository->getPosts(),
+ 'metaTitle' => 'Rector Blog: PHP Code Tips & Updates',
+ 'metaDescription' => 'Read the latest PHP refactoring tips, Rector updates, and automation guides. Level up your coding skills with our expert blog posts.',
]);
}
}
diff --git a/src/Controller/Demo/DemoController.php b/src/Controller/Demo/DemoController.php
index 0a59fde03..fd0a68da2 100644
--- a/src/Controller/Demo/DemoController.php
+++ b/src/Controller/Demo/DemoController.php
@@ -20,6 +20,8 @@ public function __invoke(Request $request): View
'page_title' => 'Try Rector Online',
'rectorRun' => RectorRun::createEmpty(),
'codeMirror' => true,
+ 'metaTitle' => 'Try Rector: Free PHP Refactoring Demo',
+ 'metaDescription' => 'Test Rector’s automated PHP refactoring tool for free. See instant code upgrades and improvements in action. Start your demo today!',
]);
}
}
diff --git a/src/Controller/DocumentationController.php b/src/Controller/DocumentationController.php
index c56c3754c..b8a4cb46d 100644
--- a/src/Controller/DocumentationController.php
+++ b/src/Controller/DocumentationController.php
@@ -24,6 +24,8 @@ public function __invoke(string $section = 'introduction'): View
'section_title' => $this->documentationMenuFactory->createSectionTitle($section),
'section_markdown_contents' => $markdownContents,
'documentation_menu_categories' => $this->documentationMenuFactory->create(),
+ 'metaTitle' => 'Rector Docs: PHP Refactoring Guide',
+ 'metaDescription' => 'Explore Rector’s documentation for PHP code refactoring and upgrades. Learn how to automate and optimize your codebase with ease.',
]);
}
}
diff --git a/src/Controller/HomepageController.php b/src/Controller/HomepageController.php
index 218f82052..3c01025bb 100644
--- a/src/Controller/HomepageController.php
+++ b/src/Controller/HomepageController.php
@@ -20,6 +20,8 @@ public function __invoke(): View
return \view('homepage/homepage', [
'page_title' => "We'll Speed Up Your Development Process by 300%",
'last_5_posts' => $this->postRepository->fetchLast(5),
+ 'metaTitle' => 'Rector: Fast PHP Code Upgrades & Refactoring',
+ 'metaDescription' => 'Automate PHP code upgrades and refactoring with Rector. Save time, reduce errors, and modernize your codebase instantly. Try it now!',
]);
}
}