Skip to content

Commit

Permalink
ACTUALLY stop pulling the docs content jungle — we only need the card…
Browse files Browse the repository at this point in the history
…Intro for this page
  • Loading branch information
simonswiss committed Jul 4, 2024
1 parent b6404a1 commit 3bd764e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions docs/pages/docs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,18 @@ export async function getStaticProps (): Promise<
docs: Omit<DocsArray, 'content'> & { content: null }
}>
> {
const docs = await reader.collections.docs.all({ resolveLinkedFiles: true })
const withParsedCardIntro = docs.map((doc) => ({
const docs = await reader.collections.docs.all()
const withParsedCardIntro = await Promise.all(docs.map(async (doc) => {
const cardIntro = await doc.entry.cardIntro()
return{
...doc,
entry: {
...doc.entry,
content: null,
cardIntro: transform(doc.entry.cardIntro.node, baseMarkdocConfig),
cardIntro: transform(cardIntro.node, baseMarkdocConfig),
},
}))
}
}))

return {
props: { docs: JSON.parse(JSON.stringify(withParsedCardIntro)) },
Expand Down

0 comments on commit 3bd764e

Please sign in to comment.