-
Notifications
You must be signed in to change notification settings - Fork 81
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
Project docs left sidebar #264
Conversation
Update template to refer to a menu defined in menus configuration named "external." Entries in the external menu will appear under a header called "project documentation." Created logic to add the new section heading Created logic to simulate page data structure for rendering in doks template logic that expects pages, not menu items Create logic to add simulated pages to the correct section Updated menus configuration to remove vestigial menu data and create a test item (cosign external docs) Signed-off-by: Patrick Smyth <[email protected]>
Resolves sigstore#250 Signed-off-by: Patrick Smyth <[email protected]>
✅ Deploy Preview for docssigstore ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
What do you think about having these open in a new tab?
Signed-off-by: Patrick Smyth <[email protected]>
That makes sense to me. I pushed a commit to make the external docs open ina new tab. Regular docs pages should be unaffected. |
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.
I'm not seeing the change in the Netlify preview, but let's merge and see
Seems to be working for me on the live site. Thanks, Lisa! |
Overview
This PR adds items to the left sidebar under the heading "Project Documentation." These items lead to external docs in the respective project repositories.
Implementation
Because Hugo generates the left sidebar from metadata in the content folder (one of the three main approaches to generating menus in Hugo), adding a section that leads to external sites required writing new template logic.
This PR removes vestigial menu metadata from the menus.toeml config file and adds a new menu, "external." This menu is referenced directly in the sidebar partial when building the sidebar. Because menu items created this way have a different structure from menu items created automatically (thanks, Hugo), the logic added in this PR takes menu items defined in the config and modifies them to look like automaticly generated menu items. A new section is then created, the new pages are added to the section metadata, and the new section is appended to the site's automatically generated sections.
Adding New Items
To edit the items in this new menu heading, future contributors should edit the toeml in
config/_default/menus/menus.en.toml
.Notes
This PR resolves #250