Skip to content

Conversation

@Polo2
Copy link
Member

@Polo2 Polo2 commented Sep 29, 2025

With this preliminary PR,
we display the missing title in sidebar component, when provided via slot before.

  • Display slot 'before' if provides, with <%= slotted :before %>
  • Favor tag h2 for this slot, to have only one h1 per page

This PR will be necessary to display a OpenAPI version select button, and prepare the release of version v3.2 (cf #404 )

compliant with Figma

before:
image

now => visible here https://deploy-preview-405--bump-content-hub.netlify.app/guides/openapi/specification/v3.1/introduction/what-is-openapi/

image image

related to https://github.com/bump-sh/bump/issues/7697

@Polo2 Polo2 self-assigned this Sep 29, 2025
@netlify
Copy link

netlify bot commented Sep 29, 2025

Deploy Preview for bump-content-hub ready!

Name Link
🔨 Latest commit 0529c08
🔍 Latest deploy log https://app.netlify.com/projects/bump-content-hub/deploys/68dbc436fe70b600081d9522
😎 Deploy Preview https://deploy-preview-405--bump-content-hub.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Polo2 Polo2 force-pushed the sidebar--display-and-adapt-missing-slot-before branch from cb889fa to d75bc05 Compare September 29, 2025 14:43
@Polo2 Polo2 marked this pull request as ready for review September 29, 2025 14:50
@Polo2 Polo2 changed the title Fix sidebar component to render slot before Fix sidebar component to render slot 'before' Sep 29, 2025
<% if resource.data.sidebar_title.present? %>
<% sidebar.slot :before do %>
<h1>
<h2>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have another h1 in this page ?
It can be a SEO leak to not have a h1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's because there is already a h1 on this page that I modified to h2

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And before this PR, the 'h1' title with content resource.data.sidebar_title was never rendered (because slot was missing)

Copy link
Contributor

@fbraure fbraure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

With this preliminary PR,
we display the missing title h2 in sidebar component,
when provided via slot `before`.

- Display slot 'before' if provides, with `<%= slotted :before %>`
- Favor tag h2 for this slot, to have only one h1 per page

This PR will be necessary to display a OpenAPI version select button,
and prepare the release of version v3.2
@Polo2 Polo2 force-pushed the sidebar--display-and-adapt-missing-slot-before branch from d75bc05 to 0529c08 Compare September 30, 2025 11:51
@Polo2 Polo2 merged commit 591b41b into main Sep 30, 2025
5 checks passed
Polo2 added a commit that referenced this pull request Oct 3, 2025
Since #405, slot 'before' is visible, with h2 tag.
But margin-top has to be removed to maintain same vertical spacing.
Polo2 added a commit that referenced this pull request Oct 3, 2025
Since #405, slot 'before' is visible, with h2 tag.
But margin-top has to be removed to maintain same vertical spacing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants