diff --git a/pages/goda-exempel/index.tsx b/pages/goda-exempel/index.tsx index fa9d3c0b6..b486d0fb6 100644 --- a/pages/goda-exempel/index.tsx +++ b/pages/goda-exempel/index.tsx @@ -7,10 +7,11 @@ export const getStaticProps: GetStaticProps = async ({ locale }) => { seo: { ...populateSeo, title: "Goda exempel - Sveriges Dataportal", - description: "Inspirerande exempel relaterat till Data & API:er.", + description: "Goda exempel på datadriven innovation i samhället.", }, basePath: `/goda-exempel`, heading: "Goda exempel", + preamble: "Goda exempel på datadriven innovation i samhället.", heroImage: renderImage({ src: "/images/goodExamplesHero.png", width: 1700, diff --git a/pages/nyheter/index.tsx b/pages/nyheter/index.tsx index cef9c77c8..2b3ea3c75 100644 --- a/pages/nyheter/index.tsx +++ b/pages/nyheter/index.tsx @@ -11,6 +11,7 @@ export const getStaticProps: GetStaticProps = async ({ locale }) => { }, basePath: `/nyheter`, heading: "Nyheter", + preamble: "Nyheter för Sveriges Dataportal", heroImage: renderImage({ src: "/images/newsHero.png", width: 1700, diff --git a/utilities/app.ts b/utilities/app.ts index d6c4ef2fb..484ed5bff 100644 --- a/utilities/app.ts +++ b/utilities/app.ts @@ -39,7 +39,12 @@ type ResolvedPage = { export const resolvePage = (props: DataportalPageProps): ResolvedPage => { switch (props.type) { case "RootAggregate": - return { seo: props.seo, heroImage: props.image, heading: props.heading }; + return { + seo: props.seo, + heroImage: props.image, + heading: props.heading, + preamble: props.preamble, + }; case "DomainAggregate": return { seo: props.seo, heroImage: props.image, heading: props.heading }; case "MultiContainer": @@ -60,6 +65,7 @@ export const resolvePage = (props: DataportalPageProps): ResolvedPage => { seo: props.seo, heading: props.heading, heroImage: props.heroImage, + preamble: props.preamble, }; case "Form": return {}; diff --git a/utilities/queryHelpers.ts b/utilities/queryHelpers.ts index 7181198c1..685f3ce9f 100644 --- a/utilities/queryHelpers.ts +++ b/utilities/queryHelpers.ts @@ -181,6 +181,7 @@ export interface PublicationListResponse { seo?: SeoDataFragment; basePath?: string; heading?: string; + preamble?: string; heroImage?: ImageFragment | null; } @@ -231,6 +232,7 @@ export interface PublicationListOptions { seo?: SeoDataFragment; basePath?: string; heading?: string; + preamble?: string; heroImage?: ImageFragment | null; } @@ -352,7 +354,7 @@ export const getPublicationsList = async ( ) => { // If nextjs should check for changes on the server const revalidate = true; - const { seo, basePath, heading, heroImage } = opts || {}; + const { seo, basePath, heading, preamble, heroImage } = opts || {}; try { const { data, error } = await client.query< @@ -394,6 +396,7 @@ export const getPublicationsList = async ( seo: seo || null, basePath: basePath || null, heading: heading || null, + preamble: preamble || null, heroImage: heroImage || null, } as PublicationListResponse, ...(revalidate