-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore(website): allow markdown in titles #9839
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
chore(website): allow markdown in titles #9839
Conversation
Thanks for the PR, @JoshuaKGoldberg! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Neat—makes sense to me :)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9839 +/- ##
=======================================
Coverage 88.04% 88.04%
=======================================
Files 407 407
Lines 13948 13948
Branches 4078 4078
=======================================
Hits 12280 12280
Misses 1355 1355
Partials 313 313
Flags with carried forward coverage won't be shown. Click here to find out more. |
A few lint errors—then we can merge it. |
Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
3231a83
// @ts-expect-error -- BlogSidebarItem only allows title: string, but we render as Markdown | ||
title: <Markdown>{item.title}</Markdown>, |
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.
This still gives a type checking error. I suspect you need to place the @ts-expect-error
elsewhere.
But really, I would suggest you do the cast here—Docusaurus is not going to change the type of BlogSidebarItem
so you don't actually gain any soundness.
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.
Docusaurus is not going to change the type of
BlogSidebarItem
Funny, I was thinking of filing an issue suggesting it allow any React node type for the title...
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.
The type of Docusaurus describes what we will pass to these components by default, not what they can accept by principle; narrower types may allow swizzlers to do other things they otherwise can't do, say, title.toUpperCase()
. Not easy to provide types in a customizable system :)
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.
Just need the branch to be up to date
PR Checklist
Overview
Swizzles the native Docusaurus components so that we can use
react-markdown
for titles.💖