diff --git a/.env.example b/.env.example index c0660ea..dc36c57 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,7 @@ APP_NAME=Laravel APP_ENV=local APP_KEY= APP_DEBUG=true -APP_URL=http://localhost +APP_URL=https://lorekeepers.games APP_LOCALE=en APP_FALLBACK_LOCALE=en diff --git a/app/Console/Commands/GenerateSitemapCommand.php b/app/Console/Commands/GenerateSitemapCommand.php index ce24b50..8373ce9 100644 --- a/app/Console/Commands/GenerateSitemapCommand.php +++ b/app/Console/Commands/GenerateSitemapCommand.php @@ -5,6 +5,7 @@ namespace App\Console\Commands; use App\Models\Game; use App\Models\User; use Illuminate\Console\Command; +use Illuminate\Support\Facades\URL; use Spatie\Sitemap\Sitemap; use Spatie\Sitemap\Tags\Url; @@ -15,6 +16,7 @@ class GenerateSitemapCommand extends Command public function handle(): int { + URL::forceScheme('https'); $sitemap = Sitemap::create() ->add(Url::create('/')->setPriority(1.0)->setChangeFrequency(Url::CHANGE_FREQUENCY_DAILY)) ->add(Url::create('/games')->setPriority(0.9)->setChangeFrequency(Url::CHANGE_FREQUENCY_DAILY)) diff --git a/resources/views/games/index.blade.php b/resources/views/games/index.blade.php index 94419d1..964d6f8 100644 --- a/resources/views/games/index.blade.php +++ b/resources/views/games/index.blade.php @@ -1,12 +1,22 @@ @extends('layouts.app') -@section('title', 'Browse Games — LoreKeepers') -@section('description', 'Browse and discover video games. Filter by genre, platform, and year. Find your next favorite game on LoreKeepers.') +@section('title', 'Browse Video Games — Filter by Genre, Platform & Year | LoreKeepers') +@section('description', 'Browse our full library of video games. Filter by genre, platform, release year, and sort by rating or popularity. Find your next favorite game.') @section('canonical', route('games.index')) +@section('og_description', 'Browse our full library of video games. Filter by genre, platform, release year, and sort by rating or popularity. Find your next favorite game.') @if($shouldNoindex ?? false) @section('robots', 'noindex,follow') @endif +@push('head_links') +@if($games->currentPage() > 1) + +@endif +@if($games->hasMorePages()) + +@endif +@endpush + @section('content')
diff --git a/resources/views/games/new-releases.blade.php b/resources/views/games/new-releases.blade.php index c1d9430..756916f 100644 --- a/resources/views/games/new-releases.blade.php +++ b/resources/views/games/new-releases.blade.php @@ -1,8 +1,9 @@ @extends('layouts.app') -@section('title', 'New Releases — LoreKeepers') -@section('description', 'Browse the latest video game releases. Stay up to date with new games across all platforms.') +@section('title', 'New Video Game Releases — Latest Games | LoreKeepers') +@section('description', 'Explore the latest video game releases sorted by release date. Track new games, add them to your library, and see what the LoreKeepers community thinks.') @section('canonical', route('games.new-releases')) +@section('og_description', 'Explore the latest video game releases sorted by release date. Track new games, add them to your library, and see what the LoreKeepers community thinks.') @section('content')
diff --git a/resources/views/games/show.blade.php b/resources/views/games/show.blade.php index 47b1e5d..17171b8 100644 --- a/resources/views/games/show.blade.php +++ b/resources/views/games/show.blade.php @@ -1,10 +1,19 @@ @extends('layouts.app') @php use Illuminate\Support\Str; @endphp -@section('title', $game->title . ' — LoreKeepers') -@section('description', $game->summary ? Str::limit($game->summary, 155) : 'Track ' . $game->title . ' on LoreKeepers.') +@section('title', $game->title . ($game->release_year ? ' (' . $game->release_year . ')' : '') . ' — Reviews, Rating & Info | LoreKeepers') +@php + $metaDesc = $game->summary ?? ''; + if (strlen($metaDesc) > 155) { + $truncated = substr($metaDesc, 0, 155); + $lastDot = strrpos($truncated, '.'); + $metaDesc = $lastDot > 100 ? substr($truncated, 0, $lastDot + 1) : Str::limit($metaDesc, 155); + } + if (!$metaDesc) $metaDesc = 'Track, rate and review ' . $game->title . ' on LoreKeepers. See community ratings, reviews, and similar games.'; +@endphp +@section('description', $metaDesc) @section('og_title', $game->title . ' — LoreKeepers') -@section('og_description', $game->summary ? Str::limit($game->summary, 155) : 'Track ' . $game->title . ' on LoreKeepers.') +@section('og_description', $game->summary ? Str::limit($game->summary, 200) : 'Track, rate and review ' . $game->title . ' on LoreKeepers.') @section('og_image', $game->cover_url ?? asset('images/og-default.jpg')) @section('og_type', 'website') @section('canonical', route('games.show', $game)) @@ -406,7 +415,7 @@
@foreach($game->screenshots as $i => $shot) @endforeach
@@ -716,7 +725,9 @@ "@@type": "VideoGame", "name": {{ json_encode($game->title) }}, "description": {{ json_encode($game->summary ?? '') }}, - "url": {{ json_encode(route('games.show', $game)) }} + "url": {{ json_encode(route('games.show', $game)) }}, + "image": {{ json_encode($game->cover_url ?? '') }}, + "datePublished": {{ json_encode($game->release_date?->toDateString() ?? '') }} @if($game->genres->isNotEmpty()) ,"genre": {{ json_encode($game->genres->pluck('name')->values()) }} @endif @@ -747,6 +758,10 @@ @endforeach ] @endif + @php $developer = $game->companies->where('pivot.role', 'developer')->first(); @endphp + @if($developer) + ,"author": {"@@type": "Organization", "name": {{ json_encode($developer->name) }}} + @endif }