mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-05 05:07:14 +02:00
* 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
707 B
707 B
Routing
This page is only accessible through version-switching. It shows how a versioned doc file becomes a webpage.
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, , is generated from the file at . The component used is @theme/DocItem
.