Add SEO-friendly titles and metadata to game profile pages #2

Open
opened 2024-01-14 14:10:59 -06:00 by jimmyb · 1 comment
Owner

Game profile pages need descriptive SEO-friendly page titles and metadata so search engines and users can identify pages by game and platform instead of seeing a generic site title.

The original issue suggested replacing the old PHP header fallback title with a dynamic per-page title. In the Laravel rebuild, page titles are already passed through the shared site layout and rendered by resources/views/partials/head.blade.php, but the public game profile page is still incomplete. This issue tracks adding SEO title and metadata support as part of the rebuilt /game/{gameId}/{gameName?} profile page.

Scope

  • Public game profile pages at /game/{gameId}/{gameName?}.
  • Dynamic <title> generation using game name and platform name.
  • Optional meta description and canonical URL support for game profiles.
  • Shared site layout/head behavior.
  • Safe fallbacks for missing platform, missing description, and unavailable games.

Acceptance Criteria

  • Active game profile pages render a descriptive <title> that includes the game name, platform name when available, and MyVideoGameList.
  • Game pages do not fall back to the generic site title when game data is available.
  • Game pages include a concise meta description based on the game description when available.
  • Game descriptions used for metadata are stripped of HTML, truncated safely, and escaped.
  • Game pages include or are ready to include a canonical URL for the canonical /game/{id}/{slug} route.
  • Missing or disabled games return 404 and do not expose stale SEO metadata.
  • Pages with missing platform or description fall back cleanly without broken titles or empty meta tags.
  • Existing non-game pages keep their current title behavior.
  • User-facing UI supports light/dark mode and follows the existing Laravel/Tailwind site layout patterns where page work is needed.

Test Coverage Required

  • Feature tests confirming game profile <title> includes game name and platform name.
  • Feature tests confirming game profile meta description is generated from the game description and safely escaped/truncated.
  • Feature tests confirming fallback behavior when platform or description is missing.
  • Feature tests confirming missing or disabled games return 404.
  • Regression tests confirming non-game pages still use their expected layout titles.
  • Tests should use Pest and focused feature coverage.
  • Run the focused affected tests, then run vendor/bin/pint --dirty before closing the issue.

Progress Checklist

  • Shared site layout accepts a page title
  • Shared head partial renders the provided title
  • Game profile route exists
  • Complete or update the public game profile view
  • Pass SEO-friendly game profile title from the game profile controller/view
  • Add game profile meta description support
  • Add canonical game URL support or confirm canonical handling
  • Handle missing platform, missing description, missing game, and disabled game states
  • Add tests for title, meta description, fallbacks, canonical behavior, and non-game title regression
  • Confirm game profile SEO metadata matches expected data coverage
Game profile pages need descriptive SEO-friendly page titles and metadata so search engines and users can identify pages by game and platform instead of seeing a generic site title. The original issue suggested replacing the old PHP header fallback title with a dynamic per-page title. In the Laravel rebuild, page titles are already passed through the shared site layout and rendered by `resources/views/partials/head.blade.php`, but the public game profile page is still incomplete. This issue tracks adding SEO title and metadata support as part of the rebuilt `/game/{gameId}/{gameName?}` profile page. ## Scope - Public game profile pages at `/game/{gameId}/{gameName?}`. - Dynamic `<title>` generation using game name and platform name. - Optional meta description and canonical URL support for game profiles. - Shared site layout/head behavior. - Safe fallbacks for missing platform, missing description, and unavailable games. ## Acceptance Criteria - Active game profile pages render a descriptive `<title>` that includes the game name, platform name when available, and MyVideoGameList. - Game pages do not fall back to the generic site title when game data is available. - Game pages include a concise meta description based on the game description when available. - Game descriptions used for metadata are stripped of HTML, truncated safely, and escaped. - Game pages include or are ready to include a canonical URL for the canonical `/game/{id}/{slug}` route. - Missing or disabled games return 404 and do not expose stale SEO metadata. - Pages with missing platform or description fall back cleanly without broken titles or empty meta tags. - Existing non-game pages keep their current title behavior. - User-facing UI supports light/dark mode and follows the existing Laravel/Tailwind site layout patterns where page work is needed. ## Test Coverage Required - Feature tests confirming game profile `<title>` includes game name and platform name. - Feature tests confirming game profile meta description is generated from the game description and safely escaped/truncated. - Feature tests confirming fallback behavior when platform or description is missing. - Feature tests confirming missing or disabled games return 404. - Regression tests confirming non-game pages still use their expected layout titles. - Tests should use Pest and focused feature coverage. - Run the focused affected tests, then run `vendor/bin/pint --dirty` before closing the issue. ## Progress Checklist - [x] Shared site layout accepts a page title - [x] Shared head partial renders the provided title - [x] Game profile route exists - [ ] Complete or update the public game profile view - [ ] Pass SEO-friendly game profile title from the game profile controller/view - [ ] Add game profile meta description support - [ ] Add canonical game URL support or confirm canonical handling - [ ] Handle missing platform, missing description, missing game, and disabled game states - [ ] Add tests for title, meta description, fallbacks, canonical behavior, and non-game title regression - [ ] Confirm game profile SEO metadata matches expected data coverage
Author
Owner

Originally posted by josh87

Looks like $page_title could be used for this actually. I'm not seeing it being used anywhere else:

josh@ubuntu-server:~/public_html/myvideogamelist.com$ git branch
* development
  master
josh@ubuntu-server:~/public_html/myvideogamelist.com$ git pull
Already up-to-date.
josh@ubuntu-server:~/public_html/myvideogamelist.com$ grep -ri '$page_title' .
josh@ubuntu-server:~/public_html/myvideogamelist.com$
**Originally posted by josh87** Looks like `$page_title` could be used for this actually. I'm not seeing it being used anywhere else: ``` bash josh@ubuntu-server:~/public_html/myvideogamelist.com$ git branch * development master josh@ubuntu-server:~/public_html/myvideogamelist.com$ git pull Already up-to-date. josh@ubuntu-server:~/public_html/myvideogamelist.com$ grep -ri '$page_title' . josh@ubuntu-server:~/public_html/myvideogamelist.com$ ```
Codex changed title from Auto-generate SEO friendly titles for game profile pages to Add SEO-friendly titles and metadata to game profile pages 2026-05-25 23:31:59 -05:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MyVideoGameList/myvideogamelist.com#2
No description provided.