Repository navigation
fix(seo): add a heading and intro to the page - #23
Merged
Merged
Conversation
Ahrefs Site Audit warns on https://wpm.silver.dev/ for "H1 tag missing or empty" and "Low word count". The game draws everything on a canvas, so the served HTML has no heading and almost no text. Add a footer below the canvas with an h1 naming the tool and a short description, rendered on the server so crawlers see it. The game appends its canvas straight to body at full height, so body becomes a flex column and the canvas shrinks to leave room for the footer instead of pushing the page into a scroll.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ahrefs still warns on https://wpm.silver.dev/ for "H1 tag missing or empty" and "Low word count". The game draws everything on a canvas, so the served HTML has no heading and almost no text.
This adds a footer below the game with an
<h1>and a short intro, rendered on the server:The game appends its canvas to
<body>at 100% height, so any in-flow element would push the game down and make the page scroll. The canvas now takes the remaining height instead. Kaplay letterboxes the game, so it keeps its aspect ratio. The footer costs 32px of height on desktop, about 3% of the game's size at 1920×1080. On phones the canvas already had spare vertical space.Evidence
Before:
curl /has 0<h1>and no body text. The canvas fills the viewport.After:
curl /has 1<h1>:Headless Chrome at each size (page height = viewport, so no scroll):
Test Plan
npm run build,tsc --noEmitandnext lintare cleannext start, thencurl /: exactly one<h1>, and the intro text is in the served HTMLwindowkeydown listener, so clicking the footer doesn't take input away from the gamemainand this branch: identical resultsMerge Danger
Door: two-way
Revert the commit to undo it.
Blast Radius: layout
Only the home page's layout changes: the game loses 32px of height on desktop. The game bundle in
public/gameis unchanged.Deploy: wpm doesn't auto-deploy from Git. After merging, deploy production by hand with
vercel --prod --scope conanbatts-projects. Ahrefs clears the warnings on its next crawl after that.Need help on this PR? Tag
@codesmith-botwith what you need.