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

[docs] Fix 404 links #36969

Merged
merged 4 commits into from
Apr 23, 2023
Merged

[docs] Fix 404 links #36969

merged 4 commits into from
Apr 23, 2023

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Apr 23, 2023

Fix issues reported in https://app.ahrefs.com/site-audit/3524616/61/issues.

However, there are still some left, regressions from #35938, e.g.

Screenshot 2023-04-23 at 14 24 06

@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work docs Improvements or additions to the documentation labels Apr 23, 2023
@mui-bot
Copy link

mui-bot commented Apr 23, 2023

@@ -4,7 +4,7 @@ import createStack from './createStack';
*
* Demos:
*
* - [Stack (Joy UI)](https://mui.com/joy/react-stack/)
* - [Stack (Joy UI)](https://mui.com/joy-ui/react-stack/)
Copy link
Member Author

Choose a reason for hiding this comment

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

404

Comment on lines +13 to +15
* TODO: this should really be fixed in findPagesMarkdown().
* Plus replaceComponentLinks() shouldn't exist in the first place,
* the markdown folder location should match the URLs.
Copy link
Member Author

Choose a reason for hiding this comment

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

The logic that converts docs markdown file location to URL location is a mess right now. One step toward making it straightforward.

@@ -211,8 +211,7 @@ async function run(argv: yargs.ArgumentsCamelCase<CommandOptions>) {
// Box's demo isn't ready
// Container's demo isn't ready
// Grid has problem with react-docgen
// Stack has problem with react-docgen
component.filename.match(/(Box|Container|ColorInversion|Grid|Stack)/)) ||
component.filename.match(/(Box|Container|ColorInversion|Grid)/)) ||
Copy link
Member Author

Choose a reason for hiding this comment

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

I fixed the Stack generation in #36785 but forgot to enable its page generation. It's why it's a 404: https://mui.com/joy-ui/api/stack/.

Comment on lines -48 to -54
const replaceStylesLinks = (markdown: string) => {
return markdown.replace(/\(\/styles\/([^)]*)\)/gm, '(/system/styles/$1)');
};

export default function replaceMarkdownLinks(markdown: string) {
return replaceStylesLinks(replaceMaterialLinks(replaceAPILinks(replaceComponentLinks(markdown))));
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Dead code, only used in the tests.

@@ -5,7 +5,7 @@ export default function DivButton() {
return (
<Button
component="a"
href="https://mui.com/about-us/"
href="https://mui.com/about/"
Copy link
Member Author

Choose a reason for hiding this comment

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

Issue from #34990. 404 link

/api/no-ssr/ /base/api/no-ssr/ 301
/pt/api/no-ssr/ /pt/base/api/no-ssr/ 301
/zh/api/no-ssr/ /zh/base/api/no-ssr/ 301
/api/no-ssr/ /base/react-no-ssr/components-api/#no-ssr 301
Copy link
Member Author

Choose a reason for hiding this comment

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

More double redirection from #36833.

@oliviertassinari oliviertassinari merged commit f3bf444 into mui:master Apr 23, 2023
8 checks passed
@oliviertassinari oliviertassinari deleted the fix-404-v2 branch April 23, 2023 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants