Skip to content

Commit

Permalink
@galactiks/astro-integration): support multilanguage move from homepa…
Browse files Browse the repository at this point in the history
…ge to index page
  • Loading branch information
emmanuelgautier committed Sep 24, 2023
1 parent 0b41875 commit 4d06818
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/adapters/astro/src/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { fileURLToPath } from 'node:url';
import { join } from 'path';

export { getStaticPaths, getHomePage } from './pages.mjs';
export { getStaticPaths, getIndexPage } from './pages.mjs';
export { integrationsPreset } from './preset.mjs';

type GalactiksOptions = {
Expand Down
18 changes: 9 additions & 9 deletions packages/adapters/astro/src/pages.mts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { getDefaultLanguage, getLanguages } from '@galactiks/config';
import { getLanguages } from '@galactiks/config';
import {
getAllPagesExceptHome,
getHomePage as explorerGetHomePage,
getPages,
getIndexPage as explorerGetIndexPage,
} from '@galactiks/explorer';

export async function getStaticPaths() {
return (await getAllPagesExceptHome({ inLanguages: getLanguages() })).map(
(page) => ({
return (await getPages({ inLanguages: getLanguages() }))
.filter((_p) => _p.slug !== '')
.map((page) => ({
params: { path: page.path.slice(1) },
props: { page },
})
);
}));
}

export function getHomePage() {
return explorerGetHomePage({ inLanguage: getDefaultLanguage() });
export function getIndexPage() {
return explorerGetIndexPage();
}

0 comments on commit 4d06818

Please sign in to comment.