-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
App router migration opengraph metadata (#1120)
* Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Move primary color to a constant so can be used in a server component (root layout) * Create rootMetadata * Fix format * Add metadata to root layout --------- Co-authored-by: eleanorreem <eleanor.reem@hotmail.co.uk>
- Loading branch information
1 parent
9366f65
commit 1ddc0a3
Showing
4 changed files
with
38 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Metadata } from 'next'; | ||
import { PRIMARY_MAIN_COLOR } from '../constants/common'; | ||
|
||
const descriptionContent = | ||
'Join us on your healing journey. Bloom is here for you to learn, heal and grow towards a confident future. It is bought to you by Chayn, a global non-profit, run by survivors and allies from around the world.'; | ||
const twitterDescriptionContent = | ||
'Join us on your healing journey. Bloom is here for you to learn, heal and grow towards a confident future. It is bought to you by Chayn, a global non-profit, run by survivors and allies from around the world.'; | ||
const imageAltContent = | ||
'An cartoon drawing of a person with almost shoulder length hair against a pink background. They have flowers and leaves coming out of their head. The word "Bloom" hovers above the person.'; | ||
|
||
// Nextjs automatically includes for each route two default meta tags, charset and viewport | ||
// https://nextjs.org/docs/app/building-your-application/optimizing/metadata#default-fields | ||
const rootMetadata: Metadata = { | ||
title: 'Bloom', | ||
openGraph: { | ||
title: 'Welcome to Bloom', | ||
description: descriptionContent, | ||
images: [{ url: '/preview.png', alt: imageAltContent }], | ||
}, | ||
twitter: { | ||
description: twitterDescriptionContent, | ||
card: 'summary_large_image', | ||
images: [], | ||
}, | ||
manifest: '/manifest.json', | ||
icons: [{ rel: 'apple-touch-icon', url: '/icons/apple/icon-120x120.png' }], | ||
other: { | ||
'theme-color': PRIMARY_MAIN_COLOR, | ||
}, | ||
}; | ||
|
||
export default rootMetadata; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters