Skip to content
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

Merged
merged 3 commits into from
Nov 7, 2023

Conversation

smythp
Copy link
Collaborator

@smythp smythp commented Oct 26, 2023

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

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]>
@netlify
Copy link

netlify bot commented Oct 26, 2023

Deploy Preview for docssigstore ready!

Name Link
🔨 Latest commit 539cd3a
🔍 Latest deploy log https://app.netlify.com/sites/docssigstore/deploys/65490cf8abcf2e0009464e64
😎 Deploy Preview https://deploy-preview-264--docssigstore.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 site configuration.

Copy link
Collaborator

@ltagliaferri ltagliaferri left a 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?

@smythp
Copy link
Collaborator Author

smythp commented Nov 6, 2023

That makes sense to me. I pushed a commit to make the external docs open ina new tab. Regular docs pages should be unaffected.

Copy link
Collaborator

@ltagliaferri ltagliaferri left a 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

@ltagliaferri ltagliaferri merged commit d433051 into sigstore:main Nov 7, 2023
6 checks passed
@smythp
Copy link
Collaborator Author

smythp commented Nov 9, 2023

Seems to be working for me on the live site. Thanks, Lisa!

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.

Link to project-specific documentation on the left sidebar
2 participants