mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-30 17:37:09 +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';
|
||||
|
||||
function FeatureRequests(): JSX.Element {
|
||||
function FeatureRequests({basePath}: {basePath: string}): JSX.Element {
|
||||
useEffect(() => {
|
||||
cannyScript();
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const {Canny} = window as any;
|
||||
Canny('render', {
|
||||
boardToken: BOARD_TOKEN,
|
||||
basePath: '/feature-requests',
|
||||
basePath,
|
||||
});
|
||||
}, []);
|
||||
}, [basePath]);
|
||||
|
||||
return (
|
||||
<Layout title="Feedback" description="Docusaurus 2 Feature Requests page">
|
||||
|
|
|
@ -15,10 +15,15 @@ function FeatureRequestsPlugin(context) {
|
|||
return {
|
||||
name: 'feature-requests-plugin',
|
||||
async contentLoaded({actions}) {
|
||||
const basePath = normalizeUrl([context.baseUrl, '/feature-requests']);
|
||||
await actions.createData('paths.json', JSON.stringify(basePath));
|
||||
actions.addRoute({
|
||||
path: normalizeUrl([context.baseUrl, '/feature-requests']),
|
||||
path: basePath,
|
||||
exact: false,
|
||||
component: '@site/src/featureRequests/FeatureRequestsPage',
|
||||
modules: {
|
||||
basePath: './feature-requests-plugin/default/paths.json',
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue