Just curious. Why choose inertia if seo is important? Are you a sponsor, so you have access to ssr?
Dec 5, 2021
9
Level 1
artesaos seotools use in inertia vue
how can we use https://github.com/artesaos/seotools with inertia vue laravel
in app.blade.php
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
{!! SEO::generate() !!}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title inertia>{{ config('app.name', 'Laravel') }}</title>
<!-- Styles -->
<link rel="stylesheet" href="{{ mix('css/app.css') }}">
@routes
<script src="{{ mix('js/app.js') }}" defer></script>
</head>
<body style="font-family: 'Roboto', sans-serif;">
@inertia
</body>
</html>
//method for all posts
public function index()
{
SEOTools::setTitle('post dashboard');
SEOTools::setDescription('Learning laravel vue inertia');
SEOTools::opengraph()->setUrl(url()->current());
SEOTools::setCanonical(url()->current());
SEOTools::opengraph()->addProperty('type', 'articles');
SEOTools::twitter()->setSite('@kumaranil60');
SEOTools::jsonLd()->addImage('/allimage/anil.jpg');
$posts = Post::with('category')->get();
return Inertia::render('Dashboard/Post/Index', [
'posts' => $posts
]);
//
}
with normal blade we all know it works but i am learning laravel with inertia and vue so i just wanted to learn this tool too
Please or to participate in this conversation.