Skip to content
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

Bad SEO scores for H1 in Hero section #4453

Open
4 tasks done
simonihmig opened this issue Dec 31, 2024 · 0 comments
Open
4 tasks done

Bad SEO scores for H1 in Hero section #4453

simonihmig opened this issue Dec 31, 2024 · 0 comments
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@simonihmig
Copy link

Describe the bug

The Hero interface docs say:

// The main text for the hero section. This will be defined
// as h1 tag.
text: string

However, this is not what it is doing. Instead it is rendering Hero.name as <h1>, and Hero.text is just a plain <p>. This leads to bad SEO scores (e.g. in SEO checkers), due to name being too short, often just a single word (the "product" name).

Reproduction

Check DOM output in any VitePress site using the default theme, e.g. https://vitepress.dev/:

document.querySelector('h1').innerText; // evaluates to 'VitePress'

Expected behavior

h1 should include Hero.text as documented.

I think ideally it could wrap around both name and text (without changing any existing styling), maybe with a visually hidden dash separating them, so for SEO and a11y the h1 of e.g. vitepress.dev would be "VitePress - Vite & Vue Powered Static Site Generator".

System Info

n/a

Additional context

No response

Validations

@simonihmig simonihmig added the bug: pending triage Maybe a bug, waiting for confirmation label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

1 participant