mirror of
https://github.com/zadam/trilium.git
synced 2025-10-28 16:56:34 +01:00
chore(website/i18n): start generating routes
This commit is contained in:
@@ -7,6 +7,7 @@ import { NotFound } from './pages/_404.jsx';
|
|||||||
import Footer from './components/Footer.js';
|
import Footer from './components/Footer.js';
|
||||||
import GetStarted from './pages/GetStarted/get-started.js';
|
import GetStarted from './pages/GetStarted/get-started.js';
|
||||||
import SupportUs from './pages/SupportUs/SupportUs.js';
|
import SupportUs from './pages/SupportUs/SupportUs.js';
|
||||||
|
import { LOCALES } from './i18n';
|
||||||
|
|
||||||
export function App(props: {repoStargazersCount: number}) {
|
export function App(props: {repoStargazersCount: number}) {
|
||||||
return (
|
return (
|
||||||
@@ -35,6 +36,17 @@ export async function prerender(data) {
|
|||||||
// This ensures the GitHub API is not called on every page load in the client.
|
// This ensures the GitHub API is not called on every page load in the client.
|
||||||
const stargazersCount = await getRepoStargazersCount();
|
const stargazersCount = await getRepoStargazersCount();
|
||||||
|
|
||||||
return await ssr(<App repoStargazersCount={stargazersCount} {...data} />);
|
const result = await ssr(<App repoStargazersCount={stargazersCount} {...data} />);
|
||||||
|
console.log("Got links ", result.links);
|
||||||
|
const links: string[] = [];
|
||||||
|
for (const locale of LOCALES) {
|
||||||
|
for (const link of result.links?.values() ?? []) {
|
||||||
|
links.push(locale.id + link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
...result,
|
||||||
|
links
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user