mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 16:59:06 +02:00
docs: add advanced guides (#6296)
* docs: add advanced guides * complete * fix link * Create architecture * use png * explanations * more text * process.env.NODE_ENV * typo * Add image zoom * nit * nit * reorganize * fix links * fix links * reorganize * elaborate on presets * fix * routing docs * ssr section * more content * complete SSR guide * pathname:// * improvements * document executionenvironment * reformat * final tweaks! * avoid slug * oops
This commit is contained in:
parent
e3be77081c
commit
59022c5eea
30 changed files with 1341 additions and 535 deletions
|
@ -0,0 +1,17 @@
|
|||
# Routing
|
||||
|
||||
This page is only accessible through version-switching. It shows how a versioned doc file becomes a webpage.
|
||||
|
||||
```mdx-code-block
|
||||
import {useLatestVersion, useActiveDocContext} from '@docusaurus/plugin-content-docs/client';
|
||||
import {useLocation} from '@docusaurus/router';
|
||||
|
||||
export const URLPath = () => <code>{useLocation().pathname}</code>;
|
||||
|
||||
export const FilePath = () => {
|
||||
const currentVersion = useActiveDocContext('default').activeVersion.name;
|
||||
return <code>{currentVersion === 'current' ? './docs/' : `./versioned_docs/version-${currentVersion}/`}advanced/routing.md</code>;
|
||||
}
|
||||
```
|
||||
|
||||
This page, <URLPath />, is generated from the file at <FilePath />. The component used is `@theme/DocItem`.
|
Loading…
Add table
Add a link
Reference in a new issue