-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
feat(content-docs): allow explicitly disabling index page for generated category #6452
Conversation
✔️ [V2] 🔨 Explore the source changes: 075fc44 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61f2969015619700084c7ba0 😎 Browse the preview: https://deploy-preview-6452--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-6452--docusaurus-2.netlify.app/ |
Size Change: +1.47 kB (0%) Total Size: 722 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 👍
@@ -218,8 +218,8 @@ export const DefaultSidebarItemsGenerator: SidebarItemsGenerator = async ({ | |||
|
|||
function getCategoryLinkedDocId(): string | undefined { | |||
const link = categoryMetadata?.link; | |||
if (link) { | |||
if (link.type === 'doc') { | |||
if (link !== undefined) { |
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.
nice catch
can you add a test for this?
We already have one that you could use for inspiration:
test('uses explicit link over the index/readme.{md,mdx} naming convention', async () => {
mockCategoryMetadataFiles({
'Category/_category_.yml': {
label: 'Category label',
link: null
},
});
//...
Motivation
While #6451 allows tweaking category index conventions globally, this one offers a more local customization: by explicitly setting
link: null
, no conventions are applied for this single category.Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
One dogfood test