SEO fixes: robots.txt, canonicals, noindex, og tags, breadcrumbs, similar games, review schema

- robots.txt: proper Disallow rules + sitemap URL
- Layout: robots meta tag, fix canonical syntax, og:site_name, full Twitter Card tags
- Game pages: canonical URLs, og:type website, breadcrumb nav + JSON-LD schema
- Screenshot alt text with game title and index
- VideoGame JSON-LD: review array with rating/author/body
- Similar Games section on game detail (by genre, ordered by rating)
- browse/index: noindex on paginated or multi-filter pages
- search results: noindex + improved title
- User library and lists: noindex
- Unique meta descriptions on browse, top-rated, new-releases pages

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mark
2026-05-31 03:05:08 +03:00
co-authored by Claude Sonnet 4.6
parent bdb4457e77
commit cdf17f92d7
11 changed files with 100 additions and 9 deletions
+16 -2
View File
@@ -39,7 +39,10 @@ class GameController extends Controller
$genres = Genre::orderBy('name')->get();
$platforms = Platform::orderBy('name')->get();
return view('games.index', compact('games', 'genres', 'platforms'));
$shouldNoindex = ($request->get('page', 1) > 1) ||
(collect(['genre', 'platform', 'year', 'sort', 'q'])->filter(fn($k) => $request->filled($k))->count() >= 2);
return view('games.index', compact('games', 'genres', 'platforms', 'shouldNoindex'));
}
public function show(Game $game)
@@ -61,7 +64,18 @@ class GameController extends Controller
->limit(20)
->get();
$response = view('games.show', compact('game', 'userGame', 'userReview', 'userLists', 'comments'));
$similarGames = collect();
if ($game->genres->isNotEmpty()) {
$similarGames = Game::published()
->whereHas('genres', fn($q) => $q->whereIn('genres.id', $game->genres->pluck('id')))
->where('id', '!=', $game->id)
->where('rating_count', '>=', 1)
->orderByDesc('rating_avg')
->limit(6)
->get();
}
$response = view('games.show', compact('game', 'userGame', 'userReview', 'userLists', 'comments', 'similarGames'));
return auth()->check()
? $response
: response($response)->header('Cache-Control', 'public, max-age=300');