Skip to content

Conversation

@ben-harris-5
Copy link
Member

💸 TL;DR

The intro buttons on https://developers.reddit.com/docs don't work, but they do work if you go to https://developers.reddit.com/docs/. Additionally, all the versioned docs links (like https://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 the IntroTilePanel component 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 serve has these links work properly now, both in the versioned and unversioned folders.

@ben-harris-5 ben-harris-5 requested review from a team and Xenc5 December 29, 2025 21:41
.env.development.local
.env.test.local
.env.production.local
.idea
Copy link
Member Author

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.
Copy link
Member Author

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.

Comment on lines 36 to +48
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>
Copy link
Member Author

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.

@ben-harris-5 ben-harris-5 merged commit c81bfa8 into main Dec 30, 2025
2 checks passed
@ben-harris-5 ben-harris-5 deleted the fix-intro-tile-panels branch December 30, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant