-
-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(game): update opengraph meta description #1654
feat(game): update opengraph meta description #1654
Conversation
@@ -253,7 +253,41 @@ class='break-words whitespace-normal leading-normal' | |||
); | |||
?> | |||
<?php if ($isFullyFeaturedGame): ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if you want to tackle it as part of this PR, but the mature hub warning doesn't go through this path, and that's what I'd expect web crawlers to encounter:
<meta property="og:title" content="~Homebrew~ Larry and the Long Look for a Luscious Lover (NES)">
<meta property="og:description" content="~Homebrew~ Larry and the Long Look for a Luscious Lover (NES)">
<meta property="og:image" content="http://localhost/assets/images/favicon.webp">
<meta property="og:url" content="http://localhost/game/17703">
<meta property="og:type" content="website">
After warning:
<meta property="og:title" content="~Homebrew~ Larry and the Long Look for a Luscious Lover (NES)">
<meta property="og:description" content="There are 54 worth 275 (299) points. ~Homebrew~ Larry and the Long Look for a Luscious Lover for NES - explore and compete on this classic game at RetroAchievements.">
<meta property="og:image" content="http://media.retroachievements.org/Images/047004.png">
<meta property="og:url" content="http://localhost/game/17703">
<meta property="og:type" content="retroachievements:game">
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, hubs aren't handled.
<meta property="og:title" content="[Series - Dragon Quest \| Dragon Warrior] (Hubs)">
<meta property="og:description" content="[Series - Dragon Quest \| Dragon Warrior] (Hubs)">
<meta property="og:image" content="http://localhost/assets/images/favicon.webp">
<meta property="og:url" content="http://localhost/game/6708">
<meta property="og:type" content="website">
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably worth handling these as a separate unit of work. Note: Because the title and description are the same, Google is falling back to using another tag we render into <head>
:
<meta name="description" content="Adding achievements to your favourite retro games since 2012">
For the mature hub games, I think this is probably okay:
For hubs themselves, the same thing is happening, but we can probably do a lot to enhance this experience:
However, I must confess I don't want to add more "special" hub logic into gameInfo.php unless absolutely necessary.
This PR updates the OG description tag on game pages to provide a little more context on the page and also slightly improve SEO on the page itself. Currently the descriptions are short enough that Google "guesses" to fill in the blanks, and unfortunately a portion of the content it fills in isn't very helpful.
Also, these links are commonly shared on Discord. For games with achievements, we can provide helpful context to the user before they click through.
Using the example above, let's pretend our target game is Super Mario Bros. for NES.
Before
"Game Info for Super Mario Bros. (NES)" ... google starts guessing here
After, game has achievements
"There are 78 achievements worth 800 (5,944) points. Super Mario Bros. for NES - explore and compete on this classic game at RetroAchievements."
After, game has no achievements
"No achievements have been created yet for Super Mario Bros.. Join RetroAchievements to request achievements for Super Mario Bros. and earn achievements on many other classic games."
After, game is an event
"Junior Developer Graduate: An event at RetroAchievements. Check out the page for more details on this unique challenge."