-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: integrate contentful to F36 website #1973
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/contentful-apps/forma-36/2VBYHyJKTgQR2mKtLU8ip62owWDZ |
|
`query { | ||
kbAppArticleCollection(where: { slug_exists: true }) { | ||
items { | ||
${ARTICLE_GRAPHQL_FIELDS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm gonna use simpler query over here. only thing we need here is slug, but on the separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work 👏
No blockers, the only comment is that I would consider refactoring [...slug].tsx
page as a follow-up.
for (const entry of links.entries.block) { | ||
entryMap.set(entry.sys.id, entry); | ||
} | ||
return { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages/website/pages/[...slug].tsx
Outdated
@@ -58,76 +53,142 @@ export default function ComponentPage({ | |||
</PropsContextProvider> | |||
</> | |||
); | |||
}; | |||
|
|||
// TODO: mrege Heading and getToC to getTableOfContents from 'mdx-utils' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you plan to do it in a separate story?
packages/website/pages/[...slug].tsx
Outdated
// [WIP]: I started adding stronger types to this function but I could not finish | ||
// that's why I renamed some stuff here, I was trying to follow this: | ||
// https://nextjs.org/docs/basic-features/typescript#static-generation-and-server-side-rendering | ||
export const getStaticProps = async (context: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would separate some parts into functions because right now it's a bit hard to read and understand. For example the part with shortIntroText can be isolated
* refactor: improve ComponentPage typing * refactor: move ToC utils to same file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Gui Santos <guilherme.goncalvessantos@gmail.com>
Adding contentful to Forma 36 website:
TODO in the future: