Skip to content

SEO Task: Correct H1s on Root Domain #474

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

bhumi1102
Copy link
Contributor

This PR addresses the issues mentioned in this task.

Note: I did not make all suggested H2 to H1 updates (as that affects the styles and layout in undesirable ways). In some cases I updated the existing the H1 to be a bit more description.

@bhumi1102
Copy link
Contributor Author

cc: @AmandaPerino, @jathayde

@AmandaPerino
Copy link
Collaborator

Would you be able to share screenshots of what is affected in the design? I don't think we should shy away from making more significant changes to the CSS - this is the point of this project, and why I pulled @jathayde into it. We just need to understand ahead of time where all of the changes will cascade.

@jathayde
Copy link
Contributor

jathayde commented Apr 30, 2025

To echo @AmandaPerino comment, if the style gets messy then we can adjust it with specific CSS overrides. I would recommend creating a cheat sheet of the headline styles for the site as they exist, regardless of the HTML they attach to. Something more like main-headline or whatever. Create your type scale/hierarchy of type and then you can apply those styles to maintain the visual output. Happy to do a call or discuss/brainstorm here on how we can make this work in practice.

The starting point is the semantic markup of the document. That should take precedence.

@bhumi1102
Copy link
Contributor Author

bhumi1102 commented Apr 30, 2025

Attaching some screenshots here for changes in this PR.

Changing duplicate h1 to h2 on homepage /index.html:

Screen Shot 2025-04-30 at 1 43 21 PM Screen Shot 2025-04-30 at 1 42 49 PM

Adding an h1 on world/2025/index.html:

Screen Shot 2025-04-30 at 1 48 54 PM Screen Shot 2025-04-30 at 1 49 05 PM

@bhumi1102
Copy link
Contributor Author

bhumi1102 commented Apr 30, 2025

Here is a before/after of suggested change (by Ranker) that I chose not to make. To me, it doesn't seem to add anything but let me know you think. In terms of seach, when I search "rails docs" or "ruby on rails docs", the 1st result is the guides page and 2nd is this /docs page.

Instead of adding that "Ruby on Rails Docs" h1, I did update existing h2 to h1.
Current:
Screen Shot 2025-04-30 at 1 54 24 PM
With suggested change:
Screen Shot 2025-04-30 at 1 54 06 PM

@bhumi1102
Copy link
Contributor Author

Hi @AmandaPerino - I almost forgot, thanks for the reminder about screenshots, I added them now! Looking back the only 2 changes I didn't make were about adding an H1 on top of an H2, where the text of the H1 didn't seem to add anything new (the docs one above, and one of doximity page). If you like the 2nd image above though, I can go ahead and update! The only impact on the styles is the diff between h1 and h2 - font size, etc.

@bhumi1102
Copy link
Contributor Author

I would recommend creating a cheat sheet of the headline styles for the site as they exist, regardless of the HTML they attach to. Something more like main-headline or whatever.

Hi @jathayde 👋 Good to see you again, I remember meeting at Rails World in Toronto.

So, I think I get what you're saying - we should update the html tags to what semantically makes sense (h1, h2 etc.) and then apply styles with classes like main-headline, etc. And not be afraid to change the markup if it makes sense for SEO because of styles. We can "fix" the styles as needed. That makes sense, I will keep that in mind as I tackle the rest of the SEO tasks.

Also, I would be happy to do a call with you to go over the CSS for this site. (I have no strong opinions about CSS/design, and as a "fullstack" developer who leans towards the "backend", I shall humbly take any guidance  😂)

@jathayde
Copy link
Contributor

jathayde commented May 9, 2025

@bhumi1102 So in the similar fashion discussed on #475 we can do the home h1 => h2 conversion to still mimic the larger size. I feel we want to namespace the home page however, to limit it to there. I think the most robust way would be to pass the page id if present into a class name on <body>, like this (in default.html template):

<body class="{% if page.id %}page-{{ page.id }}{% endif %}">

I think that would work. so we'd have body.page-home (we could remove page- if you want, I just have it to ensure there's no namespace collisions with existing ids reused).

@bhumi1102
Copy link
Contributor Author

we can do the home h1 => h2 conversion to still mimic the larger size.

Hi @jathayde - so our desire is to change the markup to h2 but still keep the h1 styles? In that case I just pushed a commit implementing what you suggest above about body.page-home. Let me know if that captures what you mean..

@jathayde
Copy link
Contributor

@bhumi1102 this would be the same kind of changes as I discussed in #475, but with a different name spacing for each block. I'd recommend we change them to h2 and add class="homestyle" or something like that. Then we put the h1 attributes from _headline.scss into a CSS block for h2.homestyle or something equivalent.

@bhumi1102
Copy link
Contributor Author

@bhumi1102 this would be the same kind of changes as I discussed in #475, but with a different name spacing for each block. I'd recommend we change them to h2 and add class="homestyle" or something like that. Then we put the h1 attributes from _headline.scss into a CSS block for h2.homestyle or something equivalent.

If you look at the current diff, I've implemented the body.page-home suggested in this comment. So is the h2.homestyle CSS block you mentioned above is instead of the body.page-home idea? Making sure I'm clear on that before making more changes...

And is this the h1 attributes from _headline.scss you mean?:

  h1 {
    color: $color-red;
    font-size: 47px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 43px;
  }

@bhumi1102
Copy link
Contributor Author

I've made the last change and resolved merge conflict with main. This one good to merge CC: @AmandaPerino, @jathayde

@AmandaPerino
Copy link
Collaborator

Here is a before/after of suggested change (by Ranker) that I chose not to make. To me, it doesn't seem to add anything but let me know you think. In terms of seach, when I search "rails docs" or "ruby on rails docs", the 1st result is the guides page and 2nd is this /docs page.

Instead of adding that "Ruby on Rails Docs" h1, I did update existing h2 to h1.

Can we please make this header: Docs: Everything you need to get started.

That way "docs" is in the H1 as intended but nothing else has changed.

@AmandaPerino
Copy link
Collaborator

Attaching some screenshots here for changes in this PR.

Changing duplicate h1 to h2 on homepage /index.html:

I'm having a hard time telling from the thread, but did the font size for these new h2's (You're in good company.) change?

@bhumi1102
Copy link
Contributor Author

bhumi1102 commented Jun 5, 2025

I'm having a hard time telling from the thread, but did the font size for these new h2's (You're in good company.) change?

Hi @AmandaPerino - the font size of "you're in good company" and such did not change. The goal with the changes has been to update the markup (from h1 to h2) while retaining the existing styles, so visually the page looks the same. Here is a screenshot from my localhost deploy:

Screen Shot 2025-06-04 at 8 24 26 PM

@zzak
Copy link
Member

zzak commented Jun 7, 2025

Couple of side-by-side screenshots for comparison.

I like the heading on the blog!

There is some noticeable shift to the spacing on the homepage when looking at them, but I don't think it's a huge deal, just notice it especially in the second screenshot you can see it looking at the "Everything you need" box.

Screenshot from 2025-06-08 06-28-35

Screenshot from 2025-06-08 06-28-58

Screenshot from 2025-06-08 06-29-57

Screenshot from 2025-06-08 06-30-51

@bhumi1102
Copy link
Contributor Author

Can we please make this header: Docs: Everything you need to get started.

That way "docs" is in the H1 as intended but nothing else has changed.

I missed this comment last week. I've updated it how you suggested now. Here's a screenshot:

Screen Shot 2025-06-09 at 8 32 53 AM

@bhumi1102
Copy link
Contributor Author

Couple of side-by-side screenshots for comparison.

I like the heading on the blog!

There is some noticeable shift to the spacing on the homepage when looking at them, but I don't think it's a huge deal, just notice it especially in the second screenshot you can see it looking at the "Everything you need" box.

Thanks for taking a look @zzak! 🎉 For the spacing (I'm trying to notice what you mean), are there any additional CSS changes we need or is it alright as is? Otherwise, I think I've addressed all the comments @AmandaPerino.

@jathayde
Copy link
Contributor

jathayde commented Jun 9, 2025

I'd guess the line-height or a margin on that different H is the culprit, but it's not something that bothers me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants