-
Notifications
You must be signed in to change notification settings - Fork 4
Add a link for creating a GitHub issue #205
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Amplify deployment status
|
f3466c5
to
fc1a0b0
Compare
fc1a0b0
to
3245937
Compare
3245937
to
a2fb3dc
Compare
Closes #110 In the previous docs site (github.com/gravitational/docs), a "Create issue on GitHub button" was a valuable source of feedback. This change adds a link that opens a new tab with the GitHub Create Issue form, prepopulated with the URL path of the current docs page. The best positioning for such a link is not obvious. In the previous docs site, we placed the button on the right sidebar under the table of contents for a given docs page. However, on the Docusaurus site, in-page tables of contents sometimes span the entire viewport height, e.g., in the main FAQ page with its 20 H2 headers, making a button on the right sidebar difficult to find. Further, Docusaurus makes some styling assumptions about the right sidebar, like the fact that the `TOCItems` component includes a left border but the column containing it does not, that make it non-trivial to style a new component there. We would need to rework the styling of the entire right sidebar component layout. The left sidebar is also not an ideal place to add this link, since it handles navigation for the entire docs site, and it would be unexpected to find a component there that is scoped to a single page. The solution this change proposes is to add the GitHub issue link below the main title of each page, swizzling the `@theme/DocItem/Content` component. This approach requires minimal reworking of the Docusaurus component layout, but still offers users a highly visible option to report an issue that, if a user is not interested in reporting an issue, remains relatively unobtrusive. This change adds a self-contained `GitHubIssueLink` component, and we can move this to a more suitable location (or turn it from a link into a button) when time opens up.
Respond to roraback feedback.
a2fb3dc
to
fea20cb
Compare
roraback
approved these changes
May 9, 2025
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 recommend you make the tiny style changes in my comment, but good to go after that.
min-width: 0; | ||
transition: color var(--t-interaction); | ||
color: var(--ifm-font-color-base); | ||
text-align: right; |
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.
Left-align the link and include a smaller marging with the H1.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #110
In the previous docs site (github.com/gravitational/docs), a "Create issue on GitHub button" was a valuable source of feedback. This change adds a link that opens a new tab with the GitHub Create Issue form, prepopulated with the URL path of the current docs page.
The best positioning for such a link is not obvious. In the previous docs site, we placed the button on the right sidebar under the table of contents for a given docs page. However, on the Docusaurus site, in-page tables of contents sometimes span the entire viewport height, e.g., in the main FAQ page with its 20 H2 headers, making a button on the right sidebar difficult to find.
Further, Docusaurus makes some styling assumptions about the right sidebar, like the fact that the
TOCItems
component includes a left border but the column containing it does not, that make it non-trivial to style a new component there. We would need to rework the styling of the entire right sidebar component layout.The left sidebar is also not an ideal place to add this link, since it handles navigation for the entire docs site, and it would be unexpected to find a component there that is scoped to a single page.
The solution this change proposes is to add the GitHub issue link below the main title of each page, swizzling the
@theme/DocItem/Content
component. This approach requires minimal reworking of the Docusaurus component layout, but still offers users a highly visible option to report an issue that, if a user is not interested in reporting an issue, remains relatively unobtrusive.This change adds a self-contained
GitHubIssueLink
component, and we can move this to a more suitable location (or turn it from a link into a button) when time opens up.