diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-05-17 22:48:41 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-05-17 22:48:41 +0200 |
| commit | 271ef6debaca7ed9a01829dcef3a37e90a2dff05 (patch) | |
| tree | aa1513b40e7020a44cfcaaedc3a33d39ecfb8af7 /src/pages/blog | |
| parent | 4e53a8654441481029746ff4e35a4a19c8d83709 (diff) | |
chore: use persistent layout
It prevents to rerender the common components between pages (header,
footer...).
Diffstat (limited to 'src/pages/blog')
| -rw-r--r-- | src/pages/blog/index.tsx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/pages/blog/index.tsx b/src/pages/blog/index.tsx index b6ce221..2676305 100644 --- a/src/pages/blog/index.tsx +++ b/src/pages/blog/index.tsx @@ -1,6 +1,7 @@ import Notice from '@components/atoms/layout/notice'; import PostsList, { type Post } from '@components/organisms/layout/posts-list'; import LinksListWidget from '@components/organisms/widgets/links-list-widget'; +import { getLayout } from '@components/templates/layout/layout'; import PageLayout from '@components/templates/page/page-layout'; import { type EdgesResponse } from '@services/graphql/api'; import { @@ -13,7 +14,11 @@ import { getTotalThematics, } from '@services/graphql/thematics'; import { getTopicsPreview, getTotalTopics } from '@services/graphql/topics'; -import { type Article, type Meta } from '@ts/types/app'; +import { + type Article, + type Meta, + type NextPageWithLayout, +} from '@ts/types/app'; import { RawThematicPreview, RawTopicPreview, @@ -28,7 +33,7 @@ import { import useBreadcrumb from '@utils/hooks/use-breadcrumb'; import usePagination from '@utils/hooks/use-pagination'; import useSettings from '@utils/hooks/use-settings'; -import { GetStaticProps, NextPage } from 'next'; +import { GetStaticProps } from 'next'; import Head from 'next/head'; import { useRouter } from 'next/router'; import Script from 'next/script'; @@ -46,7 +51,7 @@ type BlogPageProps = { /** * Blog index page. */ -const BlogPage: NextPage<BlogPageProps> = ({ +const BlogPage: NextPageWithLayout<BlogPageProps> = ({ articles, thematicsList, topicsList, @@ -268,6 +273,9 @@ const BlogPage: NextPage<BlogPageProps> = ({ ); }; +BlogPage.getLayout = (page) => + getLayout(page, { useGrid: true, withExtraPadding: true }); + export const getStaticProps: GetStaticProps<BlogPageProps> = async ({ locale, }) => { |
