mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-18 09:07:57 +02:00
fix(website): fix i18n routes for Canny board (#5902)
This commit is contained in:
parent
0fc7adfba9
commit
c8904f1615
2 changed files with 9 additions and 4 deletions
|
@ -14,16 +14,16 @@ import styles from './styles.module.css';
|
||||||
|
|
||||||
const BOARD_TOKEN = '054e0e53-d951-b14c-7e74-9eb8f9ed2f91';
|
const BOARD_TOKEN = '054e0e53-d951-b14c-7e74-9eb8f9ed2f91';
|
||||||
|
|
||||||
function FeatureRequests(): JSX.Element {
|
function FeatureRequests({basePath}: {basePath: string}): JSX.Element {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
cannyScript();
|
cannyScript();
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
const {Canny} = window as any;
|
const {Canny} = window as any;
|
||||||
Canny('render', {
|
Canny('render', {
|
||||||
boardToken: BOARD_TOKEN,
|
boardToken: BOARD_TOKEN,
|
||||||
basePath: '/feature-requests',
|
basePath,
|
||||||
});
|
});
|
||||||
}, []);
|
}, [basePath]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout title="Feedback" description="Docusaurus 2 Feature Requests page">
|
<Layout title="Feedback" description="Docusaurus 2 Feature Requests page">
|
||||||
|
|
|
@ -15,10 +15,15 @@ function FeatureRequestsPlugin(context) {
|
||||||
return {
|
return {
|
||||||
name: 'feature-requests-plugin',
|
name: 'feature-requests-plugin',
|
||||||
async contentLoaded({actions}) {
|
async contentLoaded({actions}) {
|
||||||
|
const basePath = normalizeUrl([context.baseUrl, '/feature-requests']);
|
||||||
|
await actions.createData('paths.json', JSON.stringify(basePath));
|
||||||
actions.addRoute({
|
actions.addRoute({
|
||||||
path: normalizeUrl([context.baseUrl, '/feature-requests']),
|
path: basePath,
|
||||||
exact: false,
|
exact: false,
|
||||||
component: '@site/src/featureRequests/FeatureRequestsPage',
|
component: '@site/src/featureRequests/FeatureRequestsPage',
|
||||||
|
modules: {
|
||||||
|
basePath: './feature-requests-plugin/default/paths.json',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue