Skip to content

Commit

Permalink
docs: use Mermaid diagram for routing page (#8335)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mysterious-Dev committed Nov 16, 2022
1 parent 571f497 commit 57c632b
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 4 deletions.
19 changes: 18 additions & 1 deletion website/docs/advanced/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,24 @@ Docusaurus' routing system follows single-page application conventions: one rout

Every content plugin provides a `routeBasePath` option. It defines where the plugins append their routes to. By default, the docs plugin puts its routes under `/docs`; the blog plugin, `/blog`; and the pages plugin, `/`. You can think about the route structure like this:

![plugin routes model](/img/routes.png#gh-light-mode-only)![plugin routes model](/img/routes-dark.png#gh-dark-mode-only)
```mermaid
graph LR;
A(["https://example.com/"])
B(["/base-url/"])
C(["/docs/"])
D(["/blog/"])
E(["/"])
F["All docs <br/>routes"]
G["All blog <br/>routes"]
H["All pages <br/>routes"]
A---B;
B---C;
B---D;
B---E;
C---F;
D---G;
E---H;
```

Any route will be matched against this nested route config until a good match is found. For example, when given a route `/docs/configuration`, Docusaurus first enters the `/docs` branch, and then searches among the subroutes created by the docs plugin.

Expand Down
Binary file removed website/static/img/routes-dark.png
Binary file not shown.
Binary file removed website/static/img/routes.png
Binary file not shown.
19 changes: 18 additions & 1 deletion website/versioned_docs/version-2.0.1/advanced/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,24 @@ Docusaurus' routing system follows single-page application conventions: one rout

Every content plugin provides a `routeBasePath` option. It defines where the plugins append their routes to. By default, the docs plugin puts its routes under `/docs`; the blog plugin, `/blog`; and the pages plugin, `/`. You can think about the route structure like this:

![plugin routes model](/img/routes.png#gh-light-mode-only)![plugin routes model](/img/routes-dark.png#gh-dark-mode-only)
```mermaid
graph LR;
A(["https://example.com/"])
B(["/base-url/"])
C(["/docs/"])
D(["/blog/"])
E(["/"])
F["All docs <br/>routes"]
G["All blog <br/>routes"]
H["All pages <br/>routes"]
A---B;
B---C;
B---D;
B---E;
C---F;
D---G;
E---H;
```

Any route will be matched against this nested route config until a good match is found. For example, when given a route `/docs/configuration`, Docusaurus first enters the `/docs` branch, and then searches among the subroutes created by the docs plugin.

Expand Down
19 changes: 18 additions & 1 deletion website/versioned_docs/version-2.1.0/advanced/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,24 @@ Docusaurus' routing system follows single-page application conventions: one rout

Every content plugin provides a `routeBasePath` option. It defines where the plugins append their routes to. By default, the docs plugin puts its routes under `/docs`; the blog plugin, `/blog`; and the pages plugin, `/`. You can think about the route structure like this:

![plugin routes model](/img/routes.png#gh-light-mode-only)![plugin routes model](/img/routes-dark.png#gh-dark-mode-only)
```mermaid
graph LR;
A(["https://example.com/"])
B(["/base-url/"])
C(["/docs/"])
D(["/blog/"])
E(["/"])
F["All docs <br/>routes"]
G["All blog <br/>routes"]
H["All pages <br/>routes"]
A---B;
B---C;
B---D;
B---E;
C---F;
D---G;
E---H;
```

Any route will be matched against this nested route config until a good match is found. For example, when given a route `/docs/configuration`, Docusaurus first enters the `/docs` branch, and then searches among the subroutes created by the docs plugin.

Expand Down
19 changes: 18 additions & 1 deletion website/versioned_docs/version-2.2.0/advanced/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,24 @@ Docusaurus' routing system follows single-page application conventions: one rout

Every content plugin provides a `routeBasePath` option. It defines where the plugins append their routes to. By default, the docs plugin puts its routes under `/docs`; the blog plugin, `/blog`; and the pages plugin, `/`. You can think about the route structure like this:

![plugin routes model](/img/routes.png#gh-light-mode-only)![plugin routes model](/img/routes-dark.png#gh-dark-mode-only)
```mermaid
graph LR;
A(["https://example.com/"])
B(["/base-url/"])
C(["/docs/"])
D(["/blog/"])
E(["/"])
F["All docs <br/>routes"]
G["All blog <br/>routes"]
H["All pages <br/>routes"]
A---B;
B---C;
B---D;
B---E;
C---F;
D---G;
E---H;
```

Any route will be matched against this nested route config until a good match is found. For example, when given a route `/docs/configuration`, Docusaurus first enters the `/docs` branch, and then searches among the subroutes created by the docs plugin.

Expand Down

0 comments on commit 57c632b

Please sign in to comment.