diff --git a/src/SEOTools/Integrations/Inertia.php b/src/SEOTools/Integrations/Inertia.php new file mode 100644 index 0000000..2da01f1 --- /dev/null +++ b/src/SEOTools/Integrations/Inertia.php @@ -0,0 +1,16 @@ +jsonLdMulti()->generate(); + if (config('seotools.inertia') === true) { + $html = app(Inertia::class)->convertHeadToInertiaStyle($html); + } + return ($minify) ? str_replace(PHP_EOL, '', $html) : $html; } } diff --git a/src/resources/config/seotools.php b/src/resources/config/seotools.php index 5c52398..a109d7c 100644 --- a/src/resources/config/seotools.php +++ b/src/resources/config/seotools.php @@ -4,6 +4,7 @@ */ return [ + 'inertia' => env('SEO_TOOLS_INERTIA', false), 'meta' => [ /* * The default configurations to be used by the meta generator. diff --git a/tests/SEOTools/Integrations/InertiaTest.php b/tests/SEOTools/Integrations/InertiaTest.php new file mode 100644 index 0000000..19114e5 --- /dev/null +++ b/tests/SEOTools/Integrations/InertiaTest.php @@ -0,0 +1,66 @@ +inertia = $this->app->make(Inertia::class); + } + + public function test_convert_meta_to_inertia_style() + { + $seo = ''; + + $expected = ''; + + $converted = $this->inertia->convertHeadToInertiaStyle($seo); + + $this->assertEquals($expected, $converted); + } + + public function test_convert_canonical_link_to_inertia_style() + { + $seo = ''; + + $expected = ''; + + $converted = $this->inertia->convertHeadToInertiaStyle($seo); + + $this->assertEquals($expected, $converted); + } + + public function test_convert_title_to_inertia_style() + { + $seo = '