Skip to content

Redocly: Add support for content on redocly pages #329

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 1 commit into
base: mainframe
Choose a base branch
from

Conversation

nginx-jack
Copy link
Collaborator

@nginx-jack nginx-jack commented Jul 25, 2025

I know. I can't help myself. More redocly changes.

This removes the concept of a redocly "layout" in hugo, and instead, uses it as a standard partial in our default single.html .
The main benefit of this is that you can have other content on a page besides redocly.

The frontmatter you need:

tags:
  - api
doctypes:
  - reference
nd-api-reference: "./api/example.json"

This stops the redocly js files loading on every page.

This implementation essentially uses a css breakout, to make it spread beyond the grid.
It's still using the data-grid attribute.

Examples across all three types of media queries.

Screenshot 2025-07-29 at 15 08 21 Screenshot 2025-07-29 at 15 08 12 Screenshot 2025-07-29 at 15 07 54

@nginx-jack nginx-jack requested a review from a team as a code owner July 25, 2025 12:32
Copy link

Deploy Preview will be available once build job completes!

Name Link
😎 Deploy Preview https://frontdoor-test-docs.nginx.com/previews/nginx-hugo-theme/329/

@lamATnginx
Copy link
Collaborator

Do we want tiny redocly width?

@nginx-jack
Copy link
Collaborator Author

Do we want tiny redocly width?

Let me see if there's an easy way to expand it beyond our max content grid size 🤔

@danielledeleo
Copy link
Contributor

Redocly really needs to be full width. It's really unusable and looks awful when it's letterboxed inside our docs.

@danielledeleo
Copy link
Contributor

Screenshot 2025-07-29 at 12 06 06 PM

@@ -881,6 +881,26 @@ nav {
[data-grid="half"] {
grid-column: span 6;
}

[data-grid="breakout"] {
Copy link
Collaborator

@lamATnginx lamATnginx Jul 29, 2025

Choose a reason for hiding this comment

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

Left or right alignment is off for cards

Screenshot 2025-07-29 at 8 57 31 AM

Copy link
Collaborator

Choose a reason for hiding this comment

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

Possibly has to do with position of something in the Cards?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Issue is that if you use it on a non-direct child of the content grid, it will break. Probably should add that comment for future reference.

@danielledeleo
Copy link
Contributor

The Redocly search field is hidden by the floating navbar when scolling.

Screenshot 2025-07-29 at 12 11 29 PM Screenshot 2025-07-29 at 12 11 52 PM

Copy link
Contributor

@danielledeleo danielledeleo left a comment

Choose a reason for hiding this comment

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

Remove side padding, add gray borders top and bottom.

Scrolling hides the Redocly sidebar behind the navbar.

@@ -881,6 +881,26 @@ nav {
[data-grid="half"] {
grid-column: span 6;
}

[data-grid="breakout"] {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Issue is that if you use it on a non-direct child of the content grid, it will break. Probably should add that comment for future reference.

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.

4 participants