yew
yew copied to clipboard
Fix broken link to Yew Docs / Function Components
Description
Fixes a broken link.
Checklist
- [👍] I have reviewed my own code
- [🙈] I have added tests
It looks like there's a bunch of similar /next/ links. Would it be safe and advisable to remove the next/ part of all of them?
$ git grep -l '/next/'
.github/workflows/publish-api-docs.yml
README.md
examples/function_memory_game/README.md
examples/function_todomvc/README.md
packages/yew-macro/src/hook/body.rs
packages/yew-macro/tests/function_component_attr/hook_location-fail.stderr
packages/yew-macro/tests/hook_attr/hook_location-fail.stderr
packages/yew-macro/tests/hook_attr/hook_macro-fail.stderr
packages/yew/src/lib.rs
website/docs/concepts/contexts.mdx
website/docs/concepts/function-components/hooks/introduction.mdx
website/docs/concepts/function-components/node-refs.mdx
website/docs/concepts/function-components/state.mdx
website/docusaurus.config.js
website/src/theme/NavbarItem/DefaultNavbarItem.tsx
The git version of yew should, imo, point to the /next version of yew.rs/docs. What's happening though is that the markdown in concepts/function-components/introduction.mdx has a slug: /concepts/function-components. I suppose something similar is happening with the other non-working links. I.e. the wrong part was assuming that the markdown path ends up as the URL path, which is not the case.
The correct link, in my opinion, would be https://yew.rs/docs/next/concepts/function-components. We can apply this band-aid fix to all the wrong links, which is worthy on its own. The bigger question though: can we automate this? For example, on release, I suppose the links in rustdoc should be redirected to point to https://yew.rs/docs/0.20/ (doesn't yet exist, but similar to https://yew.rs/docs/0.18.0/getting-started/introduction).
Perhaps we can create a redirect for such a future version that we can use in rustdocs now and change the redirect to its normal URL when we release? @siku2