facebook / facebook/docusaurus

Find a way to link to category generated-index

Open
#6,041 6 comments 6 reactions 0 assignees View on GitHub
feature
Dominant language
TypeScript
Stars
66.2k
Forks
10k
Avg merge
1d 3h
Merged PRs (30d)
52

Description

### Have you read the Contributing Guidelines on issues?

- [X] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#reporting-new-issues).

### Motivation

For docs, we recommend using relative file paths:

For our new category index feature, there is no `.md` file to link to so we must use regular links.

Problem:
- Using an absolute link would not play well with versioning: `[Guides](/docs/next/category/guides).`
- Using a relative link would not play well with changing the `trailingSlash` setting: `[Guides](./category/guides).`

This is particularly annoying for our own website, as we use different settings for dogfooding on dev/deployPreview/prod. It is not easy to find a good workaround so that our site could be deployed on every env without reporting broken links 😅 (see workaround https://github.com/facebook/docusaurus/pull/5830/commits/ac44531f61eb53818cf1dd6e30a585a8526ea288)

It may be annoying for our users too.

We should probably find a way to link more easily to a category, but not sure how this should be done 🤷‍♂️

### Self-service

- [ ] I'd be willing to do some initial work on this proposal myself.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.