Tech
Two h1 tags on 500 pages: the bug that lives between two correct halves
Our blog grew from 84 posts to 1,360 in a day. Then I read one live page instead of the source, counted tags, and found two <h1> elements on 500 of them. Both halves of the code were correct. Their sum was not, and no test could see it.
Where the second heading came from
The post template prints the title from frontmatter:
< h1 > $ { esc ( fm . title )} < /h1 >
Every article starts with its own heading, because that is what a m...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to