Skip to content

Commit

Permalink
feat: add meta description (#1200)
Browse files Browse the repository at this point in the history
  • Loading branch information
annarhughes authored Nov 11, 2024
1 parent 2a037c2 commit 0dd2853
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 22 deletions.
1 change: 1 addition & 0 deletions components/head/DefaultHeadMetadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const DefaultHeadMetadata = () => {
return (
<Head>
<meta name="viewport" content="initial-scale=1, width=device-width" />
<meta property="description" content={t('description')} key="description" />
<meta property="og:title" content={t('title')} key="og-title" />
<meta property="og:description" content={t('description')} key="og-description" />
<meta property="og:image" content="/preview.png" key="og-image" />
Expand Down
5 changes: 4 additions & 1 deletion components/storyblok/StoryblokCoursePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ const StoryblokCoursePage = (props: StoryblokCoursePageProps) => {
<title>{`${t('course')}${name} • Bloom`}</title>
<meta property="og:title" content={name} key="og-title" />
{seo_description && (
<meta property="og:description" content={seo_description} key="og-description" />
<>
<meta property="description" content={seo_description} key="description" />
<meta property="og:description" content={seo_description} key="og-description" />
</>
)}
</Head>
<CourseHeader
Expand Down
15 changes: 13 additions & 2 deletions components/storyblok/StoryblokMeetTheTeamPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,19 @@ const StoryblokMeetTheTeamPage = (props: StoryblokMeetTheTeamPageProps) => {
<Head>
<title>{`${title} • Bloom`}</title>
<meta property="og:title" content={title} key="og-title" />
{seo_description && (
<meta property="og:description" content={seo_description} key="og-description" />
{(seo_description || description) && (
<>
<meta
property="description"
content={seo_description || description}
key="description"
/>
<meta
property="og:description"
content={seo_description || description}
key="og-description"
/>
</>
)}
</Head>
<Header
Expand Down
5 changes: 4 additions & 1 deletion components/storyblok/StoryblokPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ const StoryblokPage = (props: StoryblokPageProps) => {
<title>{`${title} • Bloom`}</title>
<meta property="og:title" content={title} key="og-title" />
{seo_description && (
<meta property="og:description" content={seo_description} key="og-description" />
<>
<meta property="description" content={seo_description} key="description" />
<meta property="og:description" content={seo_description} key="og-description" />
</>
)}
</Head>
<main
Expand Down
15 changes: 13 additions & 2 deletions components/storyblok/StoryblokSessionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,19 @@ const StoryblokSessionPage = (props: StoryblokSessionPageProps) => {
<Head>
<title>{`${t('session')}${name} • Bloom`}</title>
<meta property="og:title" content={name} key="og-title" />
{seo_description && (
<meta property="og:description" content={seo_description} key="og-description" />
{(seo_description || description) && (
<>
<meta
property="description"
content={seo_description || description}
key="description"
/>
<meta
property="og:description"
content={seo_description || description}
key="og-description"
/>
</>
)}
</Head>

Expand Down
5 changes: 4 additions & 1 deletion components/storyblok/StoryblokWelcomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ const StoryblokWelcomePage = (props: StoryblokWelcomePageProps) => {
<title>{`${title} • Bloom`}</title>
<meta property="og:title" content={title} key="og-title" />
{seo_description && (
<meta property="og:description" content={seo_description} key="og-description" />
<>
<meta property="description" content={seo_description} key="description" />
<meta property="og:description" content={seo_description} key="og-description" />
</>
)}
</Head>

Expand Down
17 changes: 12 additions & 5 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,18 @@ const Index: NextPage<Props> = ({ story, preview }) => {
<title>{`${story.content.title} • Bloom`}</title>
<meta property="og:title" content={story.content.title} key="og-title" />
{story.content.seo_description && (
<meta
property="og:description"
content={story.content.seo_description}
key="og-description"
/>
<>
<meta
property="description"
content={story.content.seo_description}
key="description"
/>
<meta
property="og:description"
content={story.content.seo_description}
key="og-description"
/>
</>
)}
</Head>
<HomeHeader
Expand Down
17 changes: 12 additions & 5 deletions pages/messaging.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,18 @@ const Message: NextPage<Props> = ({ story }) => {
<title>{`${story.content.title} • Bloom`}</title>
<meta property="og:title" content={story.content.title} key="og-title" />
{story.content.seo_description && (
<meta
property="og:description"
content={story.content.seo_description}
key="og-description"
/>
<>
<meta
property="description"
content={story.content.seo_description}
key="description"
/>
<meta
property="og:description"
content={story.content.seo_description}
key="og-description"
/>
</>
)}
</Head>
<Box>
Expand Down
17 changes: 12 additions & 5 deletions pages/subscription/whatsapp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,18 @@ const ManageWhatsappSubscription: NextPage<Props> = ({ story }) => {
<title>{`${story.content.title} • Bloom`}</title>
<meta property="og:title" content={story.content.title} key="og-title" />
{story.content.seo_description && (
<meta
property="og:description"
content={story.content.seo_description}
key="og-description"
/>
<>
<meta
property="description"
content={story.content.seo_description}
key="description"
/>
<meta
property="og:description"
content={story.content.seo_description}
key="og-description"
/>
</>
)}
</Head>
<Box>
Expand Down

0 comments on commit 0dd2853

Please sign in to comment.