-
Notifications
You must be signed in to change notification settings - Fork 30
Add global elastic.co nav #721
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a proof-of-concept for a navigation selector by introducing a new dropdown for selecting documentation sets and reworking navigation rendering. Key changes include:
- Adding a new TopLevelTree property in NavigationViewModel and using it in RenderNavigation.
- Updating asset scripts to import htmx as a module and wiring a new event listener on the docset selector.
- Modifying layout views by replacing the existing header with an external navigation script and adding the new docset selector.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/Elastic.Markdown/Slices/HtmlWriter.cs | Added TopLevelTree property usage in RenderNavigation for new nav. |
src/Elastic.Markdown/Assets/main.ts | Updated htmx import and added docset-selector event handling. |
src/Elastic.Markdown/Slices/_ViewModels.cs | Introduced required TopLevelTree in NavigationViewModel. |
docs/_docset.yml | Toggled the primary-nav feature flag from false to true. |
src/Elastic.Markdown/Slices/Layout/_TocTree.cshtml | Replaced anchor navigation with a select dropdown for docset choice. |
src/Elastic.Markdown/Slices/Layout/_PagesNav.cshtml | Minor UI spacing adjustment. |
src/Elastic.Markdown/Slices/Layout/_Header.cshtml | Removed the complex header in favor of an external navigation script. |
Comments suppressed due to low confidence (1)
src/Elastic.Markdown/Slices/Layout/_Header.cshtml:104
- Replacing the entire header with an external script may cause issues if the script fails to load. Consider adding a fallback or documenting the expected behavior in such cases.
<div id="elastic-nav"></div>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a proof-of-concept navigation selector by integrating a new Elastic navigation widget, updating how navigation items are rendered, and aligning configuration and view model properties accordingly.
- Introduces a new navigation container and script in the header while removing legacy navigation markup.
- Updates constructors, view models, and YAML configuration to support an “in_nav” flag and adjusted navigation item rendering.
- Refactors layout partials and grid responsive classes across several Razor views.
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/Elastic.Markdown/Slices/HtmlWriter.cs | Adds TopLevelItems to navigation render method for improved nav selection. |
docs/_docset.yml | Enables the primary-nav feature. |
src/Elastic.Markdown/IO/Navigation/DocumentationGroup.cs | Updates constructors to include an inNav flag. |
src/Elastic.Markdown/Slices/_ViewModels.cs | Introduces TopLevelItems property to support the new navigation. |
src/Elastic.Markdown/Assets/main.ts | Revises htmx import and removes legacy modifier key logic. |
src/Elastic.Markdown/Extensions/IDocsBuilderExtension.cs | Reorders interface methods for navigation injection. |
src/Elastic.Markdown/IO/Configuration/ConfigurationFile.cs | Incorporates the inNav flag when creating FolderReferences. |
src/Elastic.Markdown/IO/Configuration/ITocItem.cs | Updates FolderReference to include inNav. |
src/Elastic.Markdown/IO/DocumentationSet.cs | Changes DocumentationGroup instantiation to pass false for inNav. |
src/Elastic.Markdown/Extensions/DetectionRules/DetectionRulesDocsBuilderExtension.cs | Passes inNav to the DocumentationGroup constructor in CreateNavigationItem. |
src/Elastic.Markdown/Slices/Layout/_Header.cshtml | Replaces legacy header content with an Elastic navigation container and external script. |
src/Elastic.Markdown/Slices/Layout/_PagesNav.cshtml | Adjusts responsive classes for improved sidebar behavior. |
src/Elastic.Markdown/Slices/Layout/_SecondaryNav.cshtml | Updates nav styling and responsiveness, including replacing a hidden block with a reference link. |
src/Elastic.Markdown/Slices/Layout/_TableOfContents.cshtml | Modifies sidebar width and layout. |
src/Elastic.Markdown/Slices/Layout/_TocTree.cshtml | Adds a details element for top-level nav items when primary nav is enabled. |
src/Elastic.Markdown/Slices/_Layout.cshtml | Refines container padding and borders for layout consistency. |
src/Elastic.Markdown/Slices/Layout/_LandingPage.cshtml | Adjusts spacing and grid column classes for improved responsive layout. |
This is needed since elastic/docs-builder#721
cursorful-video-1741906274449.mp4