Skip to content

Commit

Permalink
feat(@withmoons/astro-integration): export getStaticPaths method
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelgautier committed Aug 5, 2023
1 parent 864f70b commit 8a3255e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/adapters/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
],
"dependencies": {
"@withmoons/config": "*",
"@withmoons/explorer": "*",
"astro": "2.10.1"
},
"peerDependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/adapters/astro/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { AstroIntegration } from 'astro'
import { getConfig } from '@withmoons/config'

export { getStaticPaths } from './pages'
export { integrationsPreset } from './preset'

type MoonsOptions = {
Expand Down
8 changes: 8 additions & 0 deletions packages/adapters/astro/src/pages.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { getAllPagesExceptHome } from '@withmoons/explorer'

export async function getStaticPaths() {
return (await getAllPagesExceptHome()).map((page) => ({
params: { path: page.path.slice(1) },
props: { page },
}))
}
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8a3255e

Please sign in to comment.