File tree Expand file tree Collapse file tree
public/keepsimple_/assets/longevity
pages/tools/longevity-protocol Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ interface SeoGeneratorProps {
1313 localizedSlug ?: any ;
1414 modifiedDate ?: string ;
1515 createdDate ?: string ;
16+ isLongevityPage ?: boolean ;
1617 ogTags ?: {
1718 ogDescription : string ;
1819 ogTitle : string ;
@@ -38,6 +39,7 @@ const SeoGenerator: FC<SeoGeneratorProps> = ({
3839 createdDate,
3940 modifiedDate,
4041 localizedSlug,
42+ isLongevityPage,
4143} ) => {
4244 const router = useRouter ( ) ;
4345
@@ -224,7 +226,9 @@ const SeoGenerator: FC<SeoGeneratorProps> = ({
224226 property = "og:image"
225227 content = {
226228 ogTags ?. ogImage ?. data ?. attributes ?. url
227- ? `${ process . env . NEXT_PUBLIC_STRAPI } ${ ogTags ?. ogImage ?. data ?. attributes ?. url } `
229+ ? isLongevityPage
230+ ? ogTags ?. ogImage ?. data ?. attributes ?. url
231+ : `${ process . env . NEXT_PUBLIC_STRAPI } ${ ogTags ?. ogImage ?. data ?. attributes ?. url } `
228232 : ogTags ?. ogImage ?. data ?. attributes ?. staticUrl
229233 }
230234 />
@@ -254,7 +258,9 @@ const SeoGenerator: FC<SeoGeneratorProps> = ({
254258 name = "twitter:image"
255259 content = {
256260 ogTags ?. ogImage ?. data ?. attributes ?. url
257- ? `${ process . env . NEXT_PUBLIC_STRAPI } ${ ogTags ?. ogImage ?. data ?. attributes ?. url } `
261+ ? isLongevityPage
262+ ? ogTags ?. ogImage ?. data ?. attributes ?. url
263+ : `${ process . env . NEXT_PUBLIC_STRAPI } ${ ogTags ?. ogImage ?. data ?. attributes ?. url } `
258264 : ogTags ?. ogImage ?. data ?. attributes ?. staticUrl
259265 }
260266 />
Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ export const longevityDietPath = '/keepsimple_/assets/longevity/diet';
22const heartsPath = '/keepsimple_/assets/longevity/diet/hearts/' ;
33const scaleImgPath = '/keepsimple_/assets/longevity/diet/diet-results-icons/' ;
44const backgroundImgPath = '/keepsimple_/assets/longevity/diet/diet-results-bg/' ;
5-
5+ const domain = process . env . NEXT_PUBLIC_DOMAIN ;
6+ export const ogImage = `${ domain } /keepsimple_/assets/longevity/og.png` ;
67export const images = [
78 `${ heartsPath } sugar.svg` ,
89 `${ heartsPath } seed-oil.svg` ,
@@ -144,7 +145,7 @@ export const ACTIVITY_LEVEL_SUMMARY = [
144145 minutes : 300 ,
145146 riskOfDyingEarly : '65% of early-death risk' ,
146147 cognitiveDecline : '~25–35% lower' ,
147- brainAgingActive : 'Optimized (use brain-age model) ' ,
148+ brainAgingActive : 'Optimized' ,
148149 brainAgingSedentary : 'Worst-case brain-age path' ,
149150 } ,
150151] ;
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { getWhatIsThis } from '@api/longevity/what-is-this';
44import SeoGenerator from '@components/SeoGenerator' ;
55
66import WhatIsThisLayout from '@layouts/LongevityLayouts' ;
7+ import { ogImage } from '@constants/longevity' ;
78
89const AboutProject = ( { aboutTheProject } ) => {
910 const OGTags = {
@@ -14,7 +15,7 @@ const AboutProject = ({ aboutTheProject }) => {
1415 ogImage : {
1516 data : {
1617 attributes : {
17- url : aboutTheProject [ 'en' ] ?. ogImage ?. data ?. attributes ?. url || '' ,
18+ url : ogImage ,
1819 } ,
1920 } ,
2021 } ,
@@ -29,6 +30,7 @@ const AboutProject = ({ aboutTheProject }) => {
2930 title : aboutTheProject [ 'en' ] ?. Seo ?. pageTitle || '' ,
3031 seoTitle : aboutTheProject [ 'en' ] ?. Seo ?. seoTitle || '' ,
3132 } }
33+ isLongevityPage
3234 ogTags = { OGTags }
3335 createdDate = { aboutTheProject [ 'en' ] ?. createdAt || '' }
3436 modifiedDate = { aboutTheProject [ 'en' ] ?. updatedAt || '' }
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import EnvironmentLayout from '@layouts/EnvironmentLayout/EnvironmentLayout';
55
66import { getEnvironment } from '@api/longevity/environment' ;
77import SeoGenerator from '@components/SeoGenerator' ;
8+ import { ogImage } from '@constants/longevity' ;
89
910const Environment = ( { environment } ) => {
1011 const router = useRouter ( ) ;
@@ -18,7 +19,7 @@ const Environment = ({ environment }) => {
1819 ogImage : {
1920 data : {
2021 attributes : {
21- url : environment [ 'en' ] ?. ogImage ?. data ?. attributes ?. url || '' ,
22+ url : ogImage ,
2223 } ,
2324 } ,
2425 } ,
@@ -33,6 +34,7 @@ const Environment = ({ environment }) => {
3334 title : environment [ 'en' ] ?. Seo ?. pageTitle || '' ,
3435 seoTitle : environment [ 'en' ] ?. Seo ?. seoTitle || '' ,
3536 } }
37+ isLongevityPage
3638 ogTags = { OGTags }
3739 createdDate = { environment [ 'en' ] ?. createdAt || '' }
3840 modifiedDate = { environment [ 'en' ] ?. updatedAt || '' }
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import DietLayout from '@layouts/DietLayout';
44
55import { getDiet } from '@api/longevity/diet' ;
66import SeoGenerator from '@components/SeoGenerator' ;
7+ import { ogImage } from '@constants/longevity' ;
78
89const Diet = ( { dietData } ) => {
910 const OGTags = {
@@ -14,7 +15,7 @@ const Diet = ({ dietData }) => {
1415 ogImage : {
1516 data : {
1617 attributes : {
17- url : dietData [ 'en' ] ?. ogImage ?. data ?. attributes ?. url || '' ,
18+ url : ogImage ,
1819 } ,
1920 } ,
2021 } ,
@@ -29,6 +30,7 @@ const Diet = ({ dietData }) => {
2930 title : dietData [ 'en' ] ?. Seo ?. seoTitle || '' ,
3031 seoTitle : dietData [ 'en' ] ?. Seo ?. seoTitle || '' ,
3132 } }
33+ isLongevityPage
3234 ogTags = { OGTags }
3335 createdDate = { dietData [ 'en' ] ?. createdAt || '' }
3436 modifiedDate = { dietData [ 'en' ] ?. updatedAt || '' }
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import HabitsLayout from '@layouts/HabitsLayout/HabitsLayout';
44
55import { getHabitsProtocol } from '@api/longevity/habits-protocol' ;
66import SeoGenerator from '@components/SeoGenerator' ;
7+ import { ogImage } from '@constants/longevity' ;
78
89const Lifestyle = ( { habitsData } ) => {
910 const OGTags = {
@@ -14,7 +15,7 @@ const Lifestyle = ({ habitsData }) => {
1415 ogImage : {
1516 data : {
1617 attributes : {
17- url : habitsData [ 'en' ] ?. ogImage ?. data ?. attributes ?. url || '' ,
18+ url : ogImage ,
1819 } ,
1920 } ,
2021 } ,
@@ -29,6 +30,7 @@ const Lifestyle = ({ habitsData }) => {
2930 title : habitsData [ 'en' ] ?. Seo ?. pageTitle || '' ,
3031 seoTitle : habitsData [ 'en' ] ?. Seo ?. seoTitle || '' ,
3132 } }
33+ isLongevityPage
3234 ogTags = { OGTags }
3335 createdDate = { habitsData [ 'en' ] ?. createdAt || '' }
3436 modifiedDate = { habitsData [ 'en' ] ?. updatedAt || '' }
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { getSleepSupplements } from '@api/longevity/sleep-supplements';
55
66import SleepLayout from '@layouts/SleepLayout/SleepLayout' ;
77import SeoGenerator from '@components/SeoGenerator' ;
8+ import { ogImage } from '@constants/longevity' ;
89
910const Sleep = ( { sleepData, sleepSupplements } ) => {
1011 const OGTags = {
@@ -15,7 +16,7 @@ const Sleep = ({ sleepData, sleepSupplements }) => {
1516 ogImage : {
1617 data : {
1718 attributes : {
18- url : sleepData [ 'en' ] ?. ogImage ?. data ?. attributes ?. url || '' ,
19+ url : ogImage ,
1920 } ,
2021 } ,
2122 } ,
@@ -30,6 +31,7 @@ const Sleep = ({ sleepData, sleepSupplements }) => {
3031 title : sleepData [ 'en' ] ?. Seo ?. pageTitle || '' ,
3132 seoTitle : sleepData [ 'en' ] ?. Seo ?. seoTitle || '' ,
3233 } }
34+ isLongevityPage
3335 ogTags = { OGTags }
3436 createdDate = { sleepData [ 'en' ] ?. createdAt || '' }
3537 modifiedDate = { sleepData [ 'en' ] ?. updatedAt || '' }
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import StudyLayout from '@layouts/StudyLayout';
44
55import { getStudy } from '@api/longevity/study' ;
66import SeoGenerator from '@components/SeoGenerator' ;
7+ import { ogImage } from '@constants/longevity' ;
78
89const Study = ( { studyData } ) => {
910 const OGTags = {
@@ -14,7 +15,7 @@ const Study = ({ studyData }) => {
1415 ogImage : {
1516 data : {
1617 attributes : {
17- url : studyData [ 'en' ] ?. ogImage ?. data ?. attributes ?. url || '' ,
18+ url : ogImage ,
1819 } ,
1920 } ,
2021 } ,
@@ -29,6 +30,7 @@ const Study = ({ studyData }) => {
2930 title : studyData [ 'en' ] ?. Seo ?. pageTitle || '' ,
3031 seoTitle : studyData [ 'en' ] ?. Seo ?. seoTitle || '' ,
3132 } }
33+ isLongevityPage
3234 ogTags = { OGTags }
3335 createdDate = { studyData [ 'en' ] ?. createdAt || '' }
3436 modifiedDate = { studyData [ 'en' ] ?. updatedAt || '' }
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import SupplementsLayout from '@layouts/Supplements';
44
55import { getSupplements } from '@api/longevity/supplements' ;
66import SeoGenerator from '@components/SeoGenerator' ;
7+ import { ogImage } from '@constants/longevity' ;
78
89const Supplements = ( { supplements } ) => {
910 const OGTags = {
@@ -14,7 +15,7 @@ const Supplements = ({ supplements }) => {
1415 ogImage : {
1516 data : {
1617 attributes : {
17- url : supplements [ 'en' ] ?. ogImage ?. data ?. attributes ?. url || '' ,
18+ url : ogImage ,
1819 } ,
1920 } ,
2021 } ,
@@ -29,6 +30,7 @@ const Supplements = ({ supplements }) => {
2930 title : supplements [ 'en' ] ?. Seo ?. pageTitle || '' ,
3031 seoTitle : supplements [ 'en' ] ?. Seo ?. seoTitle || '' ,
3132 } }
33+ isLongevityPage
3234 ogTags = { OGTags }
3335 createdDate = { supplements [ 'en' ] ?. createdAt || '' }
3436 modifiedDate = { supplements [ 'en' ] ?. updatedAt || '' }
You can’t perform that action at this time.
0 commit comments