a11y(blocks): render collection/markdown section titles as <h2>#3344
Open
Vidminas wants to merge 1 commit into
Open
a11y(blocks): render collection/markdown section titles as <h2>#3344Vidminas wants to merge 1 commit into
Vidminas wants to merge 1 commit into
Conversation
The collection and markdown blocks rendered their title as a styled
`<div class="text-3xl">`, so section titles ("Recent Publications", "Recent
News", β¦) never appeared in the document heading outline and screen-reader
heading navigation skipped them (WCAG 1.3.1).
Render the title as `<h2>` (keeping the visual classes), matching the portfolio
block, which already uses `<h2>`.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
β Deploy Preview for academic-demo canceled.
|
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.
The collection and markdown blocks rendered their title as a styled
<div class="text-3xl">, so section titles ("Recent Publications", "Recent News", β¦) never appeared in the document heading outline and screen-reader heading navigation skipped them (WCAG 1.3.1).π What type of change is this?
π― What is the purpose of this change?
The collection and markdown blocks render their section title as a styled
<div class="text-3xl">. So headings like "Recent Publications", "Recent News", etc. don'tappear in the document heading outline, and screen-reader heading navigation (a primary way AT
users skim a page) skips them entirely (WCAG 1.3.1).
Fix. Render the title as
<h2>, keeping the existing visual classes. This matches theportfolio block, which already uses
<h2>for its title β so it also makes the three blocksconsistent.
Verified on the
academic-cvstarter: the homepage now exposes five<h2>section headings("π My Research", "Featured Publications", "Recent Publications", "Recent & Upcoming Talks",
"Recent News") with no remaining title
<div>s.πΈ Screenshots or Screencast (if applicable)
Although it's primarily a semantic fix, because the title becomes an
<h2>it now inherits the theme's heading font (and heading line-height/tracking) instead of the body font β the same font the portfolio block's title already uses. On the academic-cv starter that's Lora (heading) vs Source Serif 4 (body); see the screenshots below. Thetext-3xl font-boldsize/weight classes are unchanged, so only the typeface shifts.The same "Recent Publications" title rendered both ways, with the real webfonts loaded:
The effect is theme-independent; both themes are shown for completeness.
βΉοΈ Documentation Check
No config or API changes. Worth noting: the markdown block's own README already claims
"Accessibility First: Semantic HTML structure with proper heading hierarchy" β which was
inaccurate while the title rendered as a
<div>. This change makes that existing claim true, so nodoc edit is needed (it's the code catching up to the docs).
π Contributor Agreement
Thank you for your contribution!