1
0
Fork 0

fix(markdown): Don't use MDX components to construct headers

Closes #4776

This is a somewhat low-tech fix for this problem.
That's because it's not entirely trivial to resolve this as the MDX
components rely on the React context to figure out the title of the
page, but the remark plugin runs in an SSR context and does not have
access to the React contenxt.

Futhermore, while we could load the context statically for dev (given
the navigation context for the docs is availabel in the prebuild data)
this would lead to problems for org because we don't know inside this
remark plugin what language the user requested.

And while I'm certain we could figure it out given enough effort, it
hardly seems worth is since this is used in very few places.

In addition, it would do nothing to solve the matter of the nested a
tags when putting a link in the title, which clashes with the
auto-generated amchor links for titles.

So new rules:

- Title cannot be a link
- You can not use `DocsTitle` as title
This commit is contained in:
joostdecock 2023-10-04 18:44:25 +02:00
parent 97520a0a7d
commit 3110e5a9a3
4 changed files with 32 additions and 17 deletions

View file

@ -4,13 +4,13 @@ title: Contribute
Looking to contribute to FreeSewing? That's wonderful.
## <DocsLink slug="howtos/ways-to-contribute" />
## Ways to contribute
There are many ways to contribute, here's some examples:
<ReadMore root='howtos/ways-to-contribute' />
## <DocsLink slug="guides/code-of-conduct" />
## Code of Conduct
All FreeSewing contributors must respect and uphold our Code of Conduct: