diff options
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/article/[slug].tsx | 4 | ||||
| -rw-r--r-- | src/pages/sujet/[slug].tsx | 3 | ||||
| -rw-r--r-- | src/pages/thematique/[slug].tsx | 3 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/pages/article/[slug].tsx b/src/pages/article/[slug].tsx index f228ff0..04ae617 100644 --- a/src/pages/article/[slug].tsx +++ b/src/pages/article/[slug].tsx @@ -26,6 +26,7 @@ import { fetchAllPostsSlugs, fetchCommentsList, fetchPost, + fetchPostsCount, } from '../../services/graphql'; import styles from '../../styles/pages/article.module.scss'; import type { Article, NextPageWithLayout, SingleComment } from '../../types'; @@ -333,7 +334,8 @@ export const getStaticProps: GetStaticProps<ArticlePageProps> = async ({ }; export const getStaticPaths: GetStaticPaths = async () => { - const slugs = await fetchAllPostsSlugs(); + const postsCount = await fetchPostsCount(); + const slugs = await fetchAllPostsSlugs(postsCount); const paths = slugs.map((slug) => { return { params: { slug } }; }); diff --git a/src/pages/sujet/[slug].tsx b/src/pages/sujet/[slug].tsx index aed7ea9..c63906f 100644 --- a/src/pages/sujet/[slug].tsx +++ b/src/pages/sujet/[slug].tsx @@ -231,7 +231,8 @@ export const getStaticProps: GetStaticProps<TopicPageProps> = async ({ }; export const getStaticPaths: GetStaticPaths = async () => { - const slugs = await fetchAllTopicsSlugs(); + const topicsCount = await fetchTopicsCount(); + const slugs = await fetchAllTopicsSlugs(topicsCount); const paths = slugs.map((slug) => { return { params: { slug } }; }); diff --git a/src/pages/thematique/[slug].tsx b/src/pages/thematique/[slug].tsx index a44c98b..f8c3404 100644 --- a/src/pages/thematique/[slug].tsx +++ b/src/pages/thematique/[slug].tsx @@ -216,7 +216,8 @@ export const getStaticProps: GetStaticProps<ThematicPageProps> = async ({ }; export const getStaticPaths: GetStaticPaths = async () => { - const slugs = await fetchAllThematicsSlugs(); + const thematicsCount = await fetchThematicsCount(); + const slugs = await fetchAllThematicsSlugs(thematicsCount); const paths = slugs.map((slug) => { return { params: { slug } }; }); |
