Skip to content

Fix duplicate h1 on homepage (SEO) - #118

Merged
NeedToUpdate merged 2 commits into
devfrom
claude/portfolio-issue-9i4fs4
Jul 21, 2026
Merged

Fix duplicate h1 on homepage (SEO)#118
NeedToUpdate merged 2 commits into
devfrom
claude/portfolio-issue-9i4fs4

Conversation

@NeedToUpdate

Copy link
Copy Markdown
Owner

What & why

Bing Webmaster Tools flagged the homepage with "More than one h1 tag — 2 instances found."

The homepage (app/page.tsx) ships two responsive hero variants:

  • a mobile layout inside <div className="md:hidden">
  • a desktop layout inside <div className="hidden md:block">

Only one is visible at a given breakpoint, but both are always in the page source — CSS only toggles visibility. Both used size="hero", which the Heading component maps to <h1>, so any crawler reading the raw HTML (Bing, and static SEO parsers generally) saw two <h1> tags.

The fix

  • Added an as="p" option to Heading (components/ui/Heading.tsx) so a heading can keep its visual size without emitting a heading tag.
  • The mobile hero keeps the single real <h1> (aligns with mobile-first indexing).
  • The desktop hero now renders as a visually-identical <p>.

Result: exactly one <h1> in the page source, with no visual or layout change on either breakpoint.

Testing

  • npx tsc --noEmit — 0 errors
  • npx jest — 67/67 passing

🤖 Generated with Claude Code


Generated by Claude Code

NeedToUpdate and others added 2 commits July 20, 2026 09:27
…bug-3aekma

Fix share_created not firing for copy-link on mobile
The homepage renders two responsive hero variants — a mobile layout
(md:hidden) and a desktop layout (hidden md:block) — that are both
always present in the page source, only toggled by CSS per breakpoint.
Both used size="hero", which maps to <h1>, so crawlers reading the raw
source (e.g. Bing Webmaster Tools) saw two <h1> tags on the page.

Keep the single <h1> on the mobile hero (mobile-first indexing) and
render the desktop duplicate as a visually-identical <p> via a new
as="p" option on Heading. Layout and styling are unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EPFpwJ3zNtXFu9rHJKtGLd
@NeedToUpdate
NeedToUpdate merged commit 7744daa into dev Jul 21, 2026
1 check passed
@NeedToUpdate
NeedToUpdate deleted the claude/portfolio-issue-9i4fs4 branch August 2, 2026 02:38
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.

2 participants