From c2d089034bea350e31e77f65d8806389e1dcebc0 Mon Sep 17 00:00:00 2001 From: Jake Laderman Date: Thu, 12 Dec 2024 17:40:46 -0500 Subject: [PATCH] make meta title and description more configurable --- pages/[keyword].tsx | 4 +-- pages/_app.tsx | 1 - pages/index.tsx | 3 --- src/components/PrimaryPage.tsx | 10 +++---- src/consts.ts | 31 +--------------------- src/data/getSiteSettings.tsx | 3 ++- src/generated/graphqlDirectus.ts | 35 ++++++++++++++++++++----- src/graph/directus/customPages.graphql | 2 ++ src/graph/directus/siteSettings.graphql | 1 + 9 files changed, 40 insertions(+), 50 deletions(-) diff --git a/pages/[keyword].tsx b/pages/[keyword].tsx index 0901cac8..b3d02397 100644 --- a/pages/[keyword].tsx +++ b/pages/[keyword].tsx @@ -68,8 +68,8 @@ export const getStaticProps = async (context) => { return propsWithGlobalSettings( { - metaTitle: 'Plural', - metaDescription: page.slug, + metaTitle: page.meta_title, + metaDescription: page.meta_description, headerVariant: HeaderVariant.min, footerVariant: FooterVariant.minAlt, components: page.components ?? [], diff --git a/pages/_app.tsx b/pages/_app.tsx index b5626b5a..b17c30ec 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -36,7 +36,6 @@ import 'swiper/css/autoplay' export type GlobalPageProps = { metaTitle?: string - metaTitleFull?: string metaDescription?: string footerVariant?: FooterVariant headerVariant?: HeaderVariant diff --git a/pages/index.tsx b/pages/index.tsx index 636df2c3..047d8ac1 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -148,9 +148,6 @@ export const getStaticProps = async () => { return propsWithGlobalSettings( { - metaTitle: 'Secure, self-hosted applications in your cloud', - metaDescription: - 'Open-source application deployment, faster than ever without sacrificing compliance.', pageQueryData: page, footerVariant: FooterVariant.kitchenSink, errors: combineErrors([error]), diff --git a/src/components/PrimaryPage.tsx b/src/components/PrimaryPage.tsx index 28457b55..68a65c88 100644 --- a/src/components/PrimaryPage.tsx +++ b/src/components/PrimaryPage.tsx @@ -1,7 +1,7 @@ import { type ReactNode, createContext } from 'react' import { type GlobalPageProps } from '@pages/_app' -import { PAGE_TITLE_PREFIX, PAGE_TITLE_SUFFIX, ROOT_TITLE } from '@src/consts' +import { PAGE_TITLE_PREFIX } from '@src/consts' import { NavDataProvider, type NavList } from '@src/contexts/NavDataContext' import { type GlobalProps } from '../utils/getGlobalProps' @@ -25,15 +25,11 @@ export default function PrimaryPage({ pageProps: GlobalPageProps globalProps: GlobalProps }) { - const { metaTitle, metaTitleFull, metaDescription } = pageProps || {} + const { metaTitle, metaDescription } = pageProps || {} const { siteSettings } = globalProps || {} const headProps = { - title: - metaTitleFull || - (metaTitle - ? `${PAGE_TITLE_PREFIX}${metaTitle}${PAGE_TITLE_SUFFIX}` - : ROOT_TITLE), + title: `${PAGE_TITLE_PREFIX}${metaTitle || siteSettings?.og_title || 'Kubernetes management'}`, description: metaDescription || siteSettings?.og_description || '', ogImage: siteSettings.og_image, } diff --git a/src/consts.ts b/src/consts.ts index b77216d8..8adc3a10 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -1,35 +1,6 @@ -import { type GlobalPageProps } from '@pages/_app' - -import { type BasicRepo } from './data/getRepos' -import { type MinStack } from './data/getStacks' - -export const ROOT_TITLE = - 'Plural | Open-source application deployment, faster than ever without sacrificing compliance.' export const PAGE_TITLE_PREFIX = 'Plural | ' -export const PAGE_TITLE_SUFFIX = '' -export const DISCORD_LINK = 'https://discord.com/invite/bEBAMXV64s' - -export const getAppMeta = (repo: BasicRepo): GlobalPageProps => { - const displayName = repo.displayName || repo.name - - if (!displayName) return {} - return { - metaTitleFull: `Deploying ${displayName} on Plural`, - metaDescription: `Use Plural to securely deploy and manage ${displayName} on Kubernetes, in your cloud.`, - } -} - -export const getStackMeta = (stack: MinStack): GlobalPageProps => { - const displayName = stack.displayName || stack.name - - if (!displayName) return {} - - return { - metaTitleFull: `Deploying the ${displayName} stack on Plural`, - metaDescription: `Use Plural to securely deploy and manage the ${displayName} stack on Kubernetes, in your cloud.`, - } -} +export const DISCORD_LINK = 'https://discord.com/invite/bEBAMXV64s' export const REVALIDATE_TIME = 600 // in seconds diff --git a/src/data/getSiteSettings.tsx b/src/data/getSiteSettings.tsx index 644dace0..89579135 100644 --- a/src/data/getSiteSettings.tsx +++ b/src/data/getSiteSettings.tsx @@ -13,7 +13,8 @@ export const getSiteSettings = ( products?: ProductPageTinyFragment[], resources?: ResourcePageTinyFragment[] ) => ({ - og_description: siteSettings.og_description ?? 'Plural', + og_title: siteSettings.og_title, + og_description: siteSettings.og_description, og_image: getImageUrl(siteSettings.og_image), main_nav: { product: { diff --git a/src/generated/graphqlDirectus.ts b/src/generated/graphqlDirectus.ts index 79053ec3..0ffa06a9 100644 --- a/src/generated/graphqlDirectus.ts +++ b/src/generated/graphqlDirectus.ts @@ -6655,6 +6655,8 @@ export type Create_Custom_Pages_Input = { date_created?: InputMaybe; date_updated?: InputMaybe; id?: InputMaybe; + meta_description?: InputMaybe; + meta_title?: InputMaybe; slug: Scalars['String']['input']; status?: InputMaybe; user_created?: InputMaybe; @@ -7132,8 +7134,11 @@ export type Create_Site_Settings_Input = { date_created?: InputMaybe; date_updated?: InputMaybe; id?: InputMaybe; + /** default/fallback meta description on pages where one isn't specified (or if one is left blank) */ og_description?: InputMaybe; og_image?: InputMaybe; + /** default/fallback meta title on pages where one isn't specified (or if one is left blank) */ + og_title?: InputMaybe; user_created?: InputMaybe; user_updated?: InputMaybe; }; @@ -7502,6 +7507,8 @@ export type Custom_Pages = { date_updated?: Maybe; date_updated_func?: Maybe; id: Scalars['ID']['output']; + meta_description?: Maybe; + meta_title?: Maybe; slug: Scalars['String']['output']; status?: Maybe; user_created?: Maybe; @@ -7558,6 +7565,8 @@ export type Custom_Pages_Aggregated_Count = { date_created?: Maybe; date_updated?: Maybe; id?: Maybe; + meta_description?: Maybe; + meta_title?: Maybe; slug?: Maybe; status?: Maybe; user_created?: Maybe; @@ -7646,6 +7655,8 @@ export type Custom_Pages_Filter = { date_updated?: InputMaybe; date_updated_func?: InputMaybe; id?: InputMaybe; + meta_description?: InputMaybe; + meta_title?: InputMaybe; slug?: InputMaybe; status?: InputMaybe; user_created?: InputMaybe; @@ -10976,8 +10987,11 @@ export type Site_Settings = { date_updated?: Maybe; date_updated_func?: Maybe; id: Scalars['ID']['output']; + /** default/fallback meta description on pages where one isn't specified (or if one is left blank) */ og_description?: Maybe; og_image?: Maybe; + /** default/fallback meta title on pages where one isn't specified (or if one is left blank) */ + og_title?: Maybe; user_created?: Maybe; user_updated?: Maybe; }; @@ -11022,6 +11036,7 @@ export type Site_Settings_Filter = { id?: InputMaybe; og_description?: InputMaybe; og_image?: InputMaybe; + og_title?: InputMaybe; user_created?: InputMaybe; user_updated?: InputMaybe; }; @@ -11993,6 +12008,8 @@ export type Update_Custom_Pages_Input = { date_created?: InputMaybe; date_updated?: InputMaybe; id?: InputMaybe; + meta_description?: InputMaybe; + meta_title?: InputMaybe; slug?: InputMaybe; status?: InputMaybe; user_created?: InputMaybe; @@ -12480,8 +12497,11 @@ export type Update_Site_Settings_Input = { date_created?: InputMaybe; date_updated?: InputMaybe; id?: InputMaybe; + /** default/fallback meta description on pages where one isn't specified (or if one is left blank) */ og_description?: InputMaybe; og_image?: InputMaybe; + /** default/fallback meta title on pages where one isn't specified (or if one is left blank) */ + og_title?: InputMaybe; user_created?: InputMaybe; user_updated?: InputMaybe; }; @@ -12589,7 +12609,7 @@ export type Update_Two_Column_Text_Input = { user_updated?: InputMaybe; }; -export type CustomPageFragment = { __typename?: 'custom_pages', id: string, slug: string, components?: Array<{ __typename?: 'custom_pages_custom_component', custom_component_id?: { __typename?: 'custom_component', id: string, theme?: string | null, spacing_top?: string | null, spacing_bottom?: string | null, item?: Array<{ __typename?: 'custom_component_item', collection?: string | null, item?: { __typename?: 'article_cards', id: string, heading?: string | null, description?: string | null, videoUrl?: string | null, date?: any | null, author?: string | null, ctas?: any | null, url?: string | null, thumbnail?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | { __typename?: 'blog_cards', id: string } | { __typename?: 'cards', cards?: Array<{ __typename?: 'cards_card', card_id?: { __typename?: 'card', heading: string, body_text: string, url?: string | null, image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | null } | null> | null } | { __typename?: 'cta', heading?: string | null, body_text?: string | null, cta_text?: string | null, cta_url?: string | null } | { __typename?: 'customer_quote', quote?: { __typename?: 'quotes', id: string, quote?: string | null, author_text?: string | null } | null } | { __typename?: 'hero', heading?: string | null, body_text?: string | null, media_type?: string | null, video_url?: string | null, cta_text?: string | null, cta_url?: string | null, image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null, form?: { __typename?: 'hubspot_forms', name?: string | null, form_id: string, portal_id?: string | null, region?: string | null } | null } | { __typename?: 'large_image', overline?: string | null, heading?: string | null, body_text?: string | null, media_type?: string | null, image_position?: string | null, video_url?: string | null, cta_text?: string | null, cta_url?: string | null, image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null, form?: { __typename?: 'hubspot_forms', name?: string | null, form_id: string, portal_id?: string | null, region?: string | null } | null } | { __typename?: 'logo_strip', logo_list?: { __typename?: 'company_logo_lists', slug?: string | null, logos?: Array<{ __typename?: 'company_logo_lists_company_logos', company_logos_id?: { __typename?: 'company_logos', slug?: string | null, name: string, url?: string | null, logo_light?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null, logo_dark?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | null } | null> | null } | null } | { __typename?: 'multi_column_text', columns?: Array<{ __typename?: 'multi_column_text_rich_text_columns', rich_text_columns_id?: { __typename?: 'rich_text_columns', icon?: string | null, heading?: string | null, body_text: string } | null } | null> | null } | { __typename?: 'our_impact', top_left_metric?: string | null, top_left_subtitle?: string | null, top_left_tooltip?: string | null, top_right_metric?: string | null, top_right_subtitle?: string | null, top_right_tooltip?: string | null, bottom_left_metric?: string | null, bottom_left_subtitle?: string | null, bottom_left_tooltip?: string | null, bottom_right_metric?: string | null, bottom_right_subtitle?: string | null, bottom_right_tooltip?: string | null } | { __typename?: 'quote_carousel', title?: string | null, quotes?: { __typename?: 'quote_lists', slug: string, items?: Array<{ __typename?: 'quote_lists_items', item?: { __typename?: 'quotes', id: string, quote?: string | null, author_text?: string | null } | null } | null> | null } | null } | { __typename?: 'section_header', overline?: string | null, title?: string | null, description?: string | null } | { __typename?: 'two_column_text', main_content: string, side_content: string } | null } | null> | null } | null } | null> | null }; +export type CustomPageFragment = { __typename?: 'custom_pages', id: string, meta_title?: string | null, meta_description?: string | null, slug: string, components?: Array<{ __typename?: 'custom_pages_custom_component', custom_component_id?: { __typename?: 'custom_component', id: string, theme?: string | null, spacing_top?: string | null, spacing_bottom?: string | null, item?: Array<{ __typename?: 'custom_component_item', collection?: string | null, item?: { __typename?: 'article_cards', id: string, heading?: string | null, description?: string | null, videoUrl?: string | null, date?: any | null, author?: string | null, ctas?: any | null, url?: string | null, thumbnail?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | { __typename?: 'blog_cards', id: string } | { __typename?: 'cards', cards?: Array<{ __typename?: 'cards_card', card_id?: { __typename?: 'card', heading: string, body_text: string, url?: string | null, image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | null } | null> | null } | { __typename?: 'cta', heading?: string | null, body_text?: string | null, cta_text?: string | null, cta_url?: string | null } | { __typename?: 'customer_quote', quote?: { __typename?: 'quotes', id: string, quote?: string | null, author_text?: string | null } | null } | { __typename?: 'hero', heading?: string | null, body_text?: string | null, media_type?: string | null, video_url?: string | null, cta_text?: string | null, cta_url?: string | null, image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null, form?: { __typename?: 'hubspot_forms', name?: string | null, form_id: string, portal_id?: string | null, region?: string | null } | null } | { __typename?: 'large_image', overline?: string | null, heading?: string | null, body_text?: string | null, media_type?: string | null, image_position?: string | null, video_url?: string | null, cta_text?: string | null, cta_url?: string | null, image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null, form?: { __typename?: 'hubspot_forms', name?: string | null, form_id: string, portal_id?: string | null, region?: string | null } | null } | { __typename?: 'logo_strip', logo_list?: { __typename?: 'company_logo_lists', slug?: string | null, logos?: Array<{ __typename?: 'company_logo_lists_company_logos', company_logos_id?: { __typename?: 'company_logos', slug?: string | null, name: string, url?: string | null, logo_light?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null, logo_dark?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | null } | null> | null } | null } | { __typename?: 'multi_column_text', columns?: Array<{ __typename?: 'multi_column_text_rich_text_columns', rich_text_columns_id?: { __typename?: 'rich_text_columns', icon?: string | null, heading?: string | null, body_text: string } | null } | null> | null } | { __typename?: 'our_impact', top_left_metric?: string | null, top_left_subtitle?: string | null, top_left_tooltip?: string | null, top_right_metric?: string | null, top_right_subtitle?: string | null, top_right_tooltip?: string | null, bottom_left_metric?: string | null, bottom_left_subtitle?: string | null, bottom_left_tooltip?: string | null, bottom_right_metric?: string | null, bottom_right_subtitle?: string | null, bottom_right_tooltip?: string | null } | { __typename?: 'quote_carousel', title?: string | null, quotes?: { __typename?: 'quote_lists', slug: string, items?: Array<{ __typename?: 'quote_lists_items', item?: { __typename?: 'quotes', id: string, quote?: string | null, author_text?: string | null } | null } | null> | null } | null } | { __typename?: 'section_header', overline?: string | null, title?: string | null, description?: string | null } | { __typename?: 'two_column_text', main_content: string, side_content: string } | null } | null> | null } | null } | null> | null }; export type CustomPageTinyFragment = { __typename?: 'custom_pages', id: string, slug: string }; @@ -12603,7 +12623,7 @@ export type CustomPageQueryVariables = Exact<{ }>; -export type CustomPageQuery = { __typename?: 'Query', custom_pages: Array<{ __typename?: 'custom_pages', id: string, slug: string, components?: Array<{ __typename?: 'custom_pages_custom_component', custom_component_id?: { __typename?: 'custom_component', id: string, theme?: string | null, spacing_top?: string | null, spacing_bottom?: string | null, item?: Array<{ __typename?: 'custom_component_item', collection?: string | null, item?: { __typename?: 'article_cards', id: string, heading?: string | null, description?: string | null, videoUrl?: string | null, date?: any | null, author?: string | null, ctas?: any | null, url?: string | null, thumbnail?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | { __typename?: 'blog_cards', id: string } | { __typename?: 'cards', cards?: Array<{ __typename?: 'cards_card', card_id?: { __typename?: 'card', heading: string, body_text: string, url?: string | null, image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | null } | null> | null } | { __typename?: 'cta', heading?: string | null, body_text?: string | null, cta_text?: string | null, cta_url?: string | null } | { __typename?: 'customer_quote', quote?: { __typename?: 'quotes', id: string, quote?: string | null, author_text?: string | null } | null } | { __typename?: 'hero', heading?: string | null, body_text?: string | null, media_type?: string | null, video_url?: string | null, cta_text?: string | null, cta_url?: string | null, image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null, form?: { __typename?: 'hubspot_forms', name?: string | null, form_id: string, portal_id?: string | null, region?: string | null } | null } | { __typename?: 'large_image', overline?: string | null, heading?: string | null, body_text?: string | null, media_type?: string | null, image_position?: string | null, video_url?: string | null, cta_text?: string | null, cta_url?: string | null, image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null, form?: { __typename?: 'hubspot_forms', name?: string | null, form_id: string, portal_id?: string | null, region?: string | null } | null } | { __typename?: 'logo_strip', logo_list?: { __typename?: 'company_logo_lists', slug?: string | null, logos?: Array<{ __typename?: 'company_logo_lists_company_logos', company_logos_id?: { __typename?: 'company_logos', slug?: string | null, name: string, url?: string | null, logo_light?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null, logo_dark?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | null } | null> | null } | null } | { __typename?: 'multi_column_text', columns?: Array<{ __typename?: 'multi_column_text_rich_text_columns', rich_text_columns_id?: { __typename?: 'rich_text_columns', icon?: string | null, heading?: string | null, body_text: string } | null } | null> | null } | { __typename?: 'our_impact', top_left_metric?: string | null, top_left_subtitle?: string | null, top_left_tooltip?: string | null, top_right_metric?: string | null, top_right_subtitle?: string | null, top_right_tooltip?: string | null, bottom_left_metric?: string | null, bottom_left_subtitle?: string | null, bottom_left_tooltip?: string | null, bottom_right_metric?: string | null, bottom_right_subtitle?: string | null, bottom_right_tooltip?: string | null } | { __typename?: 'quote_carousel', title?: string | null, quotes?: { __typename?: 'quote_lists', slug: string, items?: Array<{ __typename?: 'quote_lists_items', item?: { __typename?: 'quotes', id: string, quote?: string | null, author_text?: string | null } | null } | null> | null } | null } | { __typename?: 'section_header', overline?: string | null, title?: string | null, description?: string | null } | { __typename?: 'two_column_text', main_content: string, side_content: string } | null } | null> | null } | null } | null> | null }> }; +export type CustomPageQuery = { __typename?: 'Query', custom_pages: Array<{ __typename?: 'custom_pages', id: string, meta_title?: string | null, meta_description?: string | null, slug: string, components?: Array<{ __typename?: 'custom_pages_custom_component', custom_component_id?: { __typename?: 'custom_component', id: string, theme?: string | null, spacing_top?: string | null, spacing_bottom?: string | null, item?: Array<{ __typename?: 'custom_component_item', collection?: string | null, item?: { __typename?: 'article_cards', id: string, heading?: string | null, description?: string | null, videoUrl?: string | null, date?: any | null, author?: string | null, ctas?: any | null, url?: string | null, thumbnail?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | { __typename?: 'blog_cards', id: string } | { __typename?: 'cards', cards?: Array<{ __typename?: 'cards_card', card_id?: { __typename?: 'card', heading: string, body_text: string, url?: string | null, image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | null } | null> | null } | { __typename?: 'cta', heading?: string | null, body_text?: string | null, cta_text?: string | null, cta_url?: string | null } | { __typename?: 'customer_quote', quote?: { __typename?: 'quotes', id: string, quote?: string | null, author_text?: string | null } | null } | { __typename?: 'hero', heading?: string | null, body_text?: string | null, media_type?: string | null, video_url?: string | null, cta_text?: string | null, cta_url?: string | null, image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null, form?: { __typename?: 'hubspot_forms', name?: string | null, form_id: string, portal_id?: string | null, region?: string | null } | null } | { __typename?: 'large_image', overline?: string | null, heading?: string | null, body_text?: string | null, media_type?: string | null, image_position?: string | null, video_url?: string | null, cta_text?: string | null, cta_url?: string | null, image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null, form?: { __typename?: 'hubspot_forms', name?: string | null, form_id: string, portal_id?: string | null, region?: string | null } | null } | { __typename?: 'logo_strip', logo_list?: { __typename?: 'company_logo_lists', slug?: string | null, logos?: Array<{ __typename?: 'company_logo_lists_company_logos', company_logos_id?: { __typename?: 'company_logos', slug?: string | null, name: string, url?: string | null, logo_light?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null, logo_dark?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | null } | null> | null } | null } | { __typename?: 'multi_column_text', columns?: Array<{ __typename?: 'multi_column_text_rich_text_columns', rich_text_columns_id?: { __typename?: 'rich_text_columns', icon?: string | null, heading?: string | null, body_text: string } | null } | null> | null } | { __typename?: 'our_impact', top_left_metric?: string | null, top_left_subtitle?: string | null, top_left_tooltip?: string | null, top_right_metric?: string | null, top_right_subtitle?: string | null, top_right_tooltip?: string | null, bottom_left_metric?: string | null, bottom_left_subtitle?: string | null, bottom_left_tooltip?: string | null, bottom_right_metric?: string | null, bottom_right_subtitle?: string | null, bottom_right_tooltip?: string | null } | { __typename?: 'quote_carousel', title?: string | null, quotes?: { __typename?: 'quote_lists', slug: string, items?: Array<{ __typename?: 'quote_lists_items', item?: { __typename?: 'quotes', id: string, quote?: string | null, author_text?: string | null } | null } | null> | null } | null } | { __typename?: 'section_header', overline?: string | null, title?: string | null, description?: string | null } | { __typename?: 'two_column_text', main_content: string, side_content: string } | null } | null> | null } | null } | null> | null }> }; export type CustomComponentFragment = { __typename?: 'custom_component', id: string, theme?: string | null, spacing_top?: string | null, spacing_bottom?: string | null, item?: Array<{ __typename?: 'custom_component_item', collection?: string | null, item?: { __typename?: 'article_cards', id: string, heading?: string | null, description?: string | null, videoUrl?: string | null, date?: any | null, author?: string | null, ctas?: any | null, url?: string | null, thumbnail?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | { __typename?: 'blog_cards', id: string } | { __typename?: 'cards', cards?: Array<{ __typename?: 'cards_card', card_id?: { __typename?: 'card', heading: string, body_text: string, url?: string | null, image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | null } | null> | null } | { __typename?: 'cta', heading?: string | null, body_text?: string | null, cta_text?: string | null, cta_url?: string | null } | { __typename?: 'customer_quote', quote?: { __typename?: 'quotes', id: string, quote?: string | null, author_text?: string | null } | null } | { __typename?: 'hero', heading?: string | null, body_text?: string | null, media_type?: string | null, video_url?: string | null, cta_text?: string | null, cta_url?: string | null, image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null, form?: { __typename?: 'hubspot_forms', name?: string | null, form_id: string, portal_id?: string | null, region?: string | null } | null } | { __typename?: 'large_image', overline?: string | null, heading?: string | null, body_text?: string | null, media_type?: string | null, image_position?: string | null, video_url?: string | null, cta_text?: string | null, cta_url?: string | null, image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null, form?: { __typename?: 'hubspot_forms', name?: string | null, form_id: string, portal_id?: string | null, region?: string | null } | null } | { __typename?: 'logo_strip', logo_list?: { __typename?: 'company_logo_lists', slug?: string | null, logos?: Array<{ __typename?: 'company_logo_lists_company_logos', company_logos_id?: { __typename?: 'company_logos', slug?: string | null, name: string, url?: string | null, logo_light?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null, logo_dark?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | null } | null> | null } | null } | { __typename?: 'multi_column_text', columns?: Array<{ __typename?: 'multi_column_text_rich_text_columns', rich_text_columns_id?: { __typename?: 'rich_text_columns', icon?: string | null, heading?: string | null, body_text: string } | null } | null> | null } | { __typename?: 'our_impact', top_left_metric?: string | null, top_left_subtitle?: string | null, top_left_tooltip?: string | null, top_right_metric?: string | null, top_right_subtitle?: string | null, top_right_tooltip?: string | null, bottom_left_metric?: string | null, bottom_left_subtitle?: string | null, bottom_left_tooltip?: string | null, bottom_right_metric?: string | null, bottom_right_subtitle?: string | null, bottom_right_tooltip?: string | null } | { __typename?: 'quote_carousel', title?: string | null, quotes?: { __typename?: 'quote_lists', slug: string, items?: Array<{ __typename?: 'quote_lists_items', item?: { __typename?: 'quotes', id: string, quote?: string | null, author_text?: string | null } | null } | null> | null } | null } | { __typename?: 'section_header', overline?: string | null, title?: string | null, description?: string | null } | { __typename?: 'two_column_text', main_content: string, side_content: string } | null } | null> | null }; @@ -12639,12 +12659,12 @@ export type OurImpactComponentFragment = { __typename?: 'our_impact', top_left_m export type QuoteCarouselComponentFragment = { __typename?: 'quote_carousel', title?: string | null, quotes?: { __typename?: 'quote_lists', slug: string, items?: Array<{ __typename?: 'quote_lists_items', item?: { __typename?: 'quotes', id: string, quote?: string | null, author_text?: string | null } | null } | null> | null } | null }; -export type GlobalDataFragment = { __typename?: 'Query', site_settings?: { __typename?: 'site_settings', og_description?: string | null, og_image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | null, solutions_pages: Array<{ __typename?: 'solutions_pages', id: string, slug: string, category?: string | null, dropdown_icon?: string | null, dropdown_title?: string | null }>, product_pages: Array<{ __typename?: 'product_pages', id: string, slug: string, dropdown_icon?: string | null, dropdown_title?: string | null, dropdown_description?: string | null }>, resource_pages: Array<{ __typename?: 'resource_pages', id: string, external: boolean, slug?: string | null, url?: string | null, dropdown_title?: string | null }> }; +export type GlobalDataFragment = { __typename?: 'Query', site_settings?: { __typename?: 'site_settings', og_title?: string | null, og_description?: string | null, og_image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | null, solutions_pages: Array<{ __typename?: 'solutions_pages', id: string, slug: string, category?: string | null, dropdown_icon?: string | null, dropdown_title?: string | null }>, product_pages: Array<{ __typename?: 'product_pages', id: string, slug: string, dropdown_icon?: string | null, dropdown_title?: string | null, dropdown_description?: string | null }>, resource_pages: Array<{ __typename?: 'resource_pages', id: string, external: boolean, slug?: string | null, url?: string | null, dropdown_title?: string | null }> }; export type GetGlobalDataQueryVariables = Exact<{ [key: string]: never; }>; -export type GetGlobalDataQuery = { __typename?: 'Query', site_settings?: { __typename?: 'site_settings', og_description?: string | null, og_image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | null, solutions_pages: Array<{ __typename?: 'solutions_pages', id: string, slug: string, category?: string | null, dropdown_icon?: string | null, dropdown_title?: string | null }>, product_pages: Array<{ __typename?: 'product_pages', id: string, slug: string, dropdown_icon?: string | null, dropdown_title?: string | null, dropdown_description?: string | null }>, resource_pages: Array<{ __typename?: 'resource_pages', id: string, external: boolean, slug?: string | null, url?: string | null, dropdown_title?: string | null }> }; +export type GetGlobalDataQuery = { __typename?: 'Query', site_settings?: { __typename?: 'site_settings', og_title?: string | null, og_description?: string | null, og_image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | null, solutions_pages: Array<{ __typename?: 'solutions_pages', id: string, slug: string, category?: string | null, dropdown_icon?: string | null, dropdown_title?: string | null }>, product_pages: Array<{ __typename?: 'product_pages', id: string, slug: string, dropdown_icon?: string | null, dropdown_title?: string | null, dropdown_description?: string | null }>, resource_pages: Array<{ __typename?: 'resource_pages', id: string, external: boolean, slug?: string | null, url?: string | null, dropdown_title?: string | null }> }; export type MinJobListingFragment = { __typename?: 'job_listings', id: string, slug: string, job_title?: string | null, department?: string | null, tags?: any | null, location?: string | null, status?: string | null }; @@ -12761,12 +12781,12 @@ export type QuoteFragment = { __typename?: 'quotes', id: string, quote?: string export type QuoteListFragment = { __typename?: 'quote_lists', slug: string, items?: Array<{ __typename?: 'quote_lists_items', item?: { __typename?: 'quotes', id: string, quote?: string | null, author_text?: string | null } | null } | null> | null }; -export type SiteSettingsFragment = { __typename?: 'site_settings', og_description?: string | null, og_image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null }; +export type SiteSettingsFragment = { __typename?: 'site_settings', og_title?: string | null, og_description?: string | null, og_image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null }; export type SiteSettingsQueryVariables = Exact<{ [key: string]: never; }>; -export type SiteSettingsQuery = { __typename?: 'Query', site_settings?: { __typename?: 'site_settings', og_description?: string | null, og_image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | null }; +export type SiteSettingsQuery = { __typename?: 'Query', site_settings?: { __typename?: 'site_settings', og_title?: string | null, og_description?: string | null, og_image?: { __typename?: 'directus_files', id: string, title?: string | null, description?: string | null, tags?: any | null, filename_disk?: string | null, filename_download: string, metadata?: any | null, type?: string | null, filesize?: any | null } | null } | null }; export type MarkdownPageFragment = { __typename?: 'markdown_pages', id: string, slug?: string | null, title?: string | null, subtitle?: string | null, content?: string | null }; @@ -13055,6 +13075,8 @@ ${QuoteCarouselComponentFragmentDoc}`; export const CustomPageFragmentDoc = gql` fragment CustomPage on custom_pages { id + meta_title + meta_description slug components { custom_component_id { @@ -13071,6 +13093,7 @@ export const CustomPageTinyFragmentDoc = gql` `; export const SiteSettingsFragmentDoc = gql` fragment SiteSettings on site_settings { + og_title og_description og_image { ...ImageFile diff --git a/src/graph/directus/customPages.graphql b/src/graph/directus/customPages.graphql index 78fb692c..d9b0119d 100644 --- a/src/graph/directus/customPages.graphql +++ b/src/graph/directus/customPages.graphql @@ -1,5 +1,7 @@ fragment CustomPage on custom_pages { id + meta_title + meta_description slug components { custom_component_id { diff --git a/src/graph/directus/siteSettings.graphql b/src/graph/directus/siteSettings.graphql index 22c1e7d7..219d86ab 100644 --- a/src/graph/directus/siteSettings.graphql +++ b/src/graph/directus/siteSettings.graphql @@ -1,4 +1,5 @@ fragment SiteSettings on site_settings { + og_title og_description og_image { ...ImageFile