-
Notifications
You must be signed in to change notification settings - Fork 0
Fix the IntroTilePanel to use Docusaurus for link path resolution #10
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
Conversation
| .env.development.local | ||
| .env.test.local | ||
| .env.production.local | ||
| .idea |
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.
IntelliJ added some local files, we shouldn't commit them lol
| # Games on Reddit | ||
|
|
||
| Unleash your creativity and build engaging games inside Reddit communities with Devvit’s powerful platform. [Earn money](../earn-money/reddit_developer_funds) as players engage with your games. | ||
| Unleash your creativity and build engaging games inside Reddit communities with Devvit’s powerful platform. [Earn money](../earn-money/reddit_developer_funds.md) as players engage with your games. |
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.
There will be a biiiiig PR coming separately to fix links like this across the entire repo.
| title: 'Showcase', | ||
| image: Celebration, | ||
| href: '../examples/app-showcase', | ||
| background: 'linear-gradient(135deg, #ffe066 0%, #ff7c53 100%)', | ||
| textColor: '#5a2a00', | ||
| imageSide: 'right', | ||
| textAlign: 'left', | ||
| alt: 'Showcase', | ||
| }, | ||
| ]} | ||
| /> | ||
| > | ||
| [Quickstart](../quickstart/quickstart.md) | ||
| [Showcase](../examples/app-showcase.mdx) | ||
| </IntroTilePanel> |
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 is the highlight of how this works now. Rather than an href property, it finds the link in the body with a matching title, and uses the href of that link. This allows Docusaurus to translate this from a relative path to a markdown file, to the correct, absolute path instead.
💸 TL;DR
The intro buttons on
https://developers.reddit.com/docsdon't work, but they do work if you go tohttps://developers.reddit.com/docs/. Additionally, all the versioned docs links (likehttps://developers.reddit.com/docs/next) point you back at the unversioned version of whatever doc they link to.This is because Docusaurus does some fancy link replacement logic in
.md[x]files when you put in a link to another.md[x]file. We'd like to utilize that functionality in these buttons too! So, to get that, we have the calling code put a[markdown link](./other-file.md)in the body of theIntroTilePanelcomponent for each tile. Docusaurus will do its magic on those links at compile time, and then our code reads the href of those children to construct its own fancier links.🧪 Testing Steps / Validation
Local
yarn build && yarn servehas these links work properly now, both in the versioned and unversioned folders.