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

feat(content-docs): allow explicitly disabling index page for generated category #6452

Merged
merged 4 commits into from
Jan 27, 2022

Conversation

Josh-Cena
Copy link
Collaborator

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

@Josh-Cena Josh-Cena added the pr: new feature This PR adds a new API or behavior. label Jan 23, 2022
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jan 23, 2022
@netlify
Copy link

netlify bot commented Jan 23, 2022

✔️ [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

@github-actions
Copy link

github-actions bot commented Jan 23, 2022

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 86
🟢 Accessibility 100
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 92

Lighthouse ran on https://deploy-preview-6452--docusaurus-2.netlify.app/

@github-actions
Copy link

github-actions bot commented Jan 23, 2022

Size Change: +1.47 kB (0%)

Total Size: 722 kB

Filename Size Change
website/.docusaurus/globalData.json 47.1 kB +413 B (+1%)
website/build/assets/js/main.********.js 541 kB +1.05 kB (0%)
ℹ️ View Unchanged
Filename Size
website/build/assets/css/styles.********.css 104 kB
website/build/index.html 29.7 kB

compressed-size-action

Copy link
Collaborator

@slorber slorber left a 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) {
Copy link
Collaborator

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
      },
    });
//...

@Josh-Cena Josh-Cena merged commit 3c58d7f into main Jan 27, 2022
@Josh-Cena Josh-Cena deleted the jc/link-null branch January 27, 2022 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants