Skip to content

fix(seo): add a heading and intro to the page - #23

Merged
lautaropaske merged 1 commit into
mainfrom
lautaropaske/page-heading
Oct 30, 2026
Merged

lautaropaske merged 1 commit into
mainfrom
lautaropaske/page-heading

Conversation

@lautaropaske

@lautaropaske lautaropaske commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

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:

 <body>  (now a flex column)
   <div id="__next">  (order: 1, sits below the canvas)
+    <footer>
+      <h1>WPM by Silver.dev</h1> · <p>Typing practice with real code snippets in
+      JavaScript, Python or Go. Measure your words per minute for coding interviews.</p>
+    </footer>
   <canvas>  (appended by the game; height 100% → flex: 1, shrinks to fit)

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>:

    <footer ...><h1 class="inline text-neutral-200">WPM by Silver.dev</h1> · <p class="inline">Typing practice with real code snippets in JavaScript, Python or Go. Measure your words per minute for coding interviews.</p></footer>

    Headless Chrome at each size (page height = viewport, so no scroll):

    Viewport canvas footer
    1920×1080 1920×1048 32px
    1440×900 1440×868 32px
    iPhone 13 (390×664) 390×584 80px (wraps)

Test Plan

  • npm run build, tsc --noEmit and next lint are clean
  • next start, then curl /: exactly one <h1>, and the intro text is in the served HTML
  • Headless Chrome (SwiftShader WebGL) at 1920×1080, 1440×900 and iPhone 13: no horizontal or vertical scroll, the game stays letterboxed above the footer, and there are no page errors
  • Played on desktop: start → audio "no" → javascript → practice reaches the twoSum challenge, and typed keys register. Input is a window keydown listener, so clicking the footer doesn't take input away from the game
  • Ran the same start-menu script 3× each against main and this branch: identical results

Merge 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/game is 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.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

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.
@lautaropaske
lautaropaske merged commit 124dbfc into main Oct 30, 2026
2 checks passed
@lautaropaske
lautaropaske deleted the lautaropaske/page-heading branch October 30, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant