-
Notifications
You must be signed in to change notification settings - Fork 123
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
Fix heading structure #461
Comments
Correct for this particular page, yes, but not from Markdown evaluation point of view. This is tricky since technically both are correct depending on approach. To make this more confusing, a third option would be including semantic wrapper, eg. <h1>Blog post title from markdown frontmatter</h1>
<article class="blogpost">
<h1># First level heading from markdown</h1>
<p>...</p>
<h2>## Second level heading from markdown</h2>
<p>...</p>
<h1># First level heading from markdown</h1>
<p>...</p>
</article> with some rem adjusting CSS .blogpost > h1 h2 h3 h4 h5 h6 {
font-size: 0.85rem; // or whatever the scaling should be
} but this of course would introduce two new problems:
|
I havent looked into this at all, but some markdown->html libraries let you say what is the top level heading it generates. A11y-wise only 1 h1 per page seems to be the only viable solution. AFAIK the spec supports h1's for different sections, but support for those hasn't been implemented in any browsers. Check out this blog post about the issue. |
Also, semantically the first |
Blog posts are generated from markdown. It's pretty natural to structure the headings starting from h1 (# heading) in markdown, but this results in bad heading structure in the resulting web page. At the moment we have pages that look like this:
Correct structure would be
We should limit the headings generated from markdown to be no higher level than h2. Some posts might start from h2 already, so we cant just do
heading + 1
.The text was updated successfully, but these errors were encountered: