-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
docs: add link from every category index page to the guide page #7665
Conversation
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site settings. |
⚡️ Lighthouse report for the deploy preview of this PR
|
Size Change: +349 B (0%) Total Size: 802 kB
ℹ️ View Unchanged
|
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.
LGTM 👍
Something to consider: I think the "category generated index" name may not be very clear and users might not understand how it looks like visually.
Can we display an example index on that page?
https://deploy-preview-7665--docusaurus-2.netlify.app/docs/sidebar/items/#generated-index-page
Like <BrowserWindow><SampleGeneratedIndex/></BrowserWindow>
Just to make it clear what it looks like?
Separate PR but I'd also like to have a global plugin option so that all categories can have an index by default (instead of using additional config on each category => not convenient)
<Translate | ||
values={{ | ||
guideLink: ( | ||
<Link to={`${docPath}#category-link`}> |
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.
<Link to={`${docPath}#category-link`}> | |
<Link to={`${docPath}#generated-index-page`}> |
Should it link to the parent of child heading? 🤔 not really sure what is best
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 deliberately linked to this section, and even reordered the headings, because I added an extra tip at the top about how this should be implemented with autogenerated.
Directly beneath that there's a link to an actual page, though. A demo for the entire page would take up quite some space.
I think that makes sense |
import styles from './styles.module.css'; | ||
|
||
function HintFooter() { | ||
const docPath = useLayoutDoc('guides/docs/sidebar/items', undefined)?.path; |
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.
Ref #7402 a DocLink
component will make this a bit easier
That can be enough for now I was thinking of something simpler though, like <BrowserWindow>
<DocCardList items={useCurrentSidebarCategory().items}/>
</BrowserWindow> Or just a hardcoded list eventually. |
Pre-flight checklist
Motivation
I've seen many people asking how to implement the generated index page. Let's make it even more visible.
Also a dogfooding for wrap swizzling.
Test Plan
Test links
Deploy preview: https://deploy-preview-7665--docusaurus-2.netlify.app/docs/category/getting-started/
Related issues/PRs