Skip to content
loading...

re: 5 reasons to write Semantic HTML VIEW POST

FULL DISCUSSION
 

I learned from the linked pages about <main>. Now I have to wonder if I should be using that somehow... HTML5 is always more complicated I thought. Thanks though!

 

What were you using before,

? What makes you confused about ?
 

I have my articles wrapped in <article>, but the comments outside of it. Maybe I should put <main> around all of them! Although I read something else later the day I posted this suggesting that it's a good idea to put comments inside nested <article>s. Urgh...

If articles are the main attention section on the page, I think you can wrap them inside . Regarding the comments, honestly, I'm not really sure, but I don't think it's a big issue if you wrap them inside the along with the article itself. :)

The reason I started putting comments outside the <article> was an SEO concern. I saw in Google search console that some of my URLs with a query string that caused it to load a subtree of the comments were not having their canonicals URLs respected. I figured it was because not loading the full comment tree made it count as such different content (this happened on pages with a lot of comments) that Google refused to consider them the same page. I thought putting the comments outside of an <article> would help (and it looks like it did).

BTW your comment displays as "I think you can wrap them inside .". I don't know if that was supposed to be "inside <main>"... I think you have to use &lt; to show HTML in dev.to.

Oh, yea it should be <main> :)
Thanks for noticing.

That's a good insight though, straight off to Google Console now. Thanks. 👍🏽

code of conduct - report abuse