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 custom props through _category_.json #6780

Merged
merged 3 commits into from
Mar 5, 2022

Conversation

taejs
Copy link
Contributor

@taejs taejs commented Feb 27, 2022

Motivation

Close #6690
Resolve Feature Request: allow-customizing-category-description-in-generated-index-cards

Have you read the Contributing Guidelines on pull requests?

yes. but I have no idea how to test it.

Test Plan

Related PRs

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 27, 2022
@netlify
Copy link

netlify bot commented Feb 27, 2022

✔️ [V2]
Built without sensitive environment variables

🔨 Explore the source changes: 50d52ee

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/62233de1447eaa00073c87b1

😎 Browse the preview: https://deploy-preview-6780--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Feb 27, 2022

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 48
🟢 Accessibility 100
🟢 Best practices 92
🟢 SEO 100
🟢 PWA 90

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

Copy link
Collaborator

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, we don't want to add more root config fields for categories. Could you please just make categoryMetadata.customProps be passed to the final item? The idea is that the user can swizzle DocCard and implement whatever design through custom props.

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.

Agree with @Josh-Cena : we want to enable users to bring their own customization abilities, not add just 2 new premade and unflexible attributes

@taejs
Copy link
Contributor Author

taejs commented Mar 2, 2022

Also agree. Thanks for the feedback. After addressing the review I'm trying to resolve this error.
The docs sidebar category metadata file path=${filePath} looks invalid

CustomProps are not acceptable even though I added sidebar validation.

@Josh-Cena
Copy link
Collaborator

CustomProps are not acceptable even though I added sidebar validation.

You added validation for the sidebar item, but not for the metadata file, which has another schema

@slorber slorber marked this pull request as draft March 4, 2022 14:32
@taejs taejs changed the title feat(content-docs): add props to categoryMetaData for category card feat(content-docs): allow custom props through _category_.json Mar 5, 2022
@taejs taejs marked this pull request as ready for review March 5, 2022 08:46
@taejs
Copy link
Contributor Author

taejs commented Mar 5, 2022

Addressed reviews:
make categoryMetadata.customProps be passed to the final item.

@Josh-Cena Josh-Cena added the pr: new feature This PR adds a new API or behavior. label Mar 5, 2022
Copy link
Collaborator

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that looks great!

@Josh-Cena Josh-Cena merged commit 2e163a9 into facebook:main Mar 5, 2022
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.

Allow custom props through _category_.json
4 participants