diff --git a/app/about/page.tsx b/app/about/page.tsx index 3025c80..c14a23e 100644 --- a/app/about/page.tsx +++ b/app/about/page.tsx @@ -7,10 +7,19 @@ import {GitHubIcon, LinkedInIcon} from '@/components/icons/SocialIcons' import clsx from 'clsx' import me from '@/public/images/me.jpg' import awsCCPBadge from '@/public/images/aws-certified-cloud-practitioner-badge.png' +import {generateMetadata as _generateMetadata} from '@/lib/generateMetadata' -export const metadata = { - title: 'About - Ryan Freeman', - description: 'I’m Ryan. I live in Dublin, Ireland where I work as a software engineer.' +const meta = { + title: 'About', + heading: 'I\'m Ryan. I live in Dublin, Ireland where I work as a software engineer.', + description: 'I\'ve always had an affinity for technology, and loved making things for as long as I can remember. ' + + 'My first computer was an Amstrad CPC 464 way back in the 90s, which is ancient by modern standards. ' + + 'My passion for tinkering continued through my teens and into adulthood where I eventually found my way into software engineering.', + type: 'website' +} + +export async function generateMetadata() { + return _generateMetadata(meta) } function SocialLink({ @@ -55,14 +64,11 @@ export default async function About() {

- I’m Ryan. I live in Dublin, Ireland where I work as a software engineer. + {meta.heading}

- I've always had an affinity for technology, and loved making things for as long as I can - remember. My first computer was an Amstrad CPC 464 way back in the 90s, which is ancient by modern - standards. My passion for tinkering continued through my teens and into adulthood where I - eventually found my way into software engineering. + {meta.description}

In terms of my experience to date, I have a strong foundation in both front-end and back-end diff --git a/app/api/og-image/route.tsx b/app/api/og-image/route.tsx index 4aa1d1d..4445f73 100644 --- a/app/api/og-image/route.tsx +++ b/app/api/og-image/route.tsx @@ -29,11 +29,11 @@ export async function GET(request: Request) { width: '100%', height: '100%', display: 'flex', - textAlign: 'center', + textAlign: 'left', alignItems: 'center', justifyContent: 'center', - lineHeight: '1', - padding: '0 128px' + lineHeight: '1.1', + padding: '0 64px' }} >

- Full-stack software engineer who enjoys building cloud-native applications. + {meta.heading}

- Hi. I'm Ryan, a software engineer based in Dublin, Ireland. I'm currently working in the - aviation industry for Aer Lingus. I am passionate about personal growth and progressing in my career. This - is my personal website where you can learn more about me, read articles I've written and see projects - I've worked on. + {meta.description}

        diff --git a/app/writing/generating-dynamic-open-graph-images-with-nextjs/page.mdx b/app/writing/generating-dynamic-open-graph-images-with-nextjs/page.mdx index fd45941..8ae6324 100644 --- a/app/writing/generating-dynamic-open-graph-images-with-nextjs/page.mdx +++ b/app/writing/generating-dynamic-open-graph-images-with-nextjs/page.mdx @@ -24,7 +24,7 @@ export const metadata = { type: 'image/png' } ], - type: 'website' + type: 'article' } } diff --git a/app/writing/page.tsx b/app/writing/page.tsx index 66d163b..b4b16f6 100644 --- a/app/writing/page.tsx +++ b/app/writing/page.tsx @@ -4,30 +4,18 @@ import {Card} from '@/components/ui/Card' import {Views} from '@/components/ui/Views' import {formatDate} from '@/lib/formatDate' import {getAllArticles} from '@/lib/getAllArticles' +import {generateMetadata as _generateMetadata} from '@/lib/generateMetadata' import type {Article} from '@/types' const meta = { - title: 'Writing - Ryan Freeman', + title: 'Writing', heading: 'Writing on software engineering, and everything in between.', - description: 'All of my long-form thoughts on software engineering, and more, displayed in chronological order.' + description: 'All of my long-form thoughts on software engineering, and more, displayed in chronological order.', + type: 'website' } -export const metadata = { - ...meta, - openGraph: { - title: meta.title, - description: meta.description, - images: [ - { - url: `/api/og-image?text=${meta.heading}`, - width: 1200, - height: 600, - alt: meta.heading, - type: 'image/png' - } - ], - type: 'website' - } +export async function generateMetadata() { + return _generateMetadata(meta) } function Article({article}: { article: Article }) { @@ -57,8 +45,8 @@ export default async function Writing() { return (
        diff --git a/lib/generateMetadata.ts b/lib/generateMetadata.ts new file mode 100644 index 0000000..6ffb003 --- /dev/null +++ b/lib/generateMetadata.ts @@ -0,0 +1,27 @@ +type Meta = { + title: string + heading: string + description: string + type: string + [name: string]: string | Object +} + +export async function generateMetadata(meta: Meta) { + return { + ...meta, + openGraph: { + title: meta.title, + description: meta.description, + images: [ + { + url: `/api/og-image?text=${meta.heading}`, + width: 1200, + height: 600, + alt: meta.heading, + type: 'image/png' + } + ], + type: meta.type + } + } +} \ No newline at end of file diff --git a/types/index.ts b/types/index.ts index fda6804..a7d74ce 100644 --- a/types/index.ts +++ b/types/index.ts @@ -22,18 +22,4 @@ export type Repo = { name: string color: string } -} - -export type Metric = { - title: string - value: number | string - group: string - href: string -} - -export type MetricGroup = [ - { - groupName: string, - groupItems: Metric[] - } -] +} \ No newline at end of file