From 40913ad4019d8e8b96bb23061f88484c331075bb Mon Sep 17 00:00:00 2001 From: Ryan Freeman Date: Thu, 17 Oct 2024 20:58:15 +0100 Subject: [PATCH] Fix canonical tags --- app/about/page.tsx | 5 ++++- app/api/og-image/route.tsx | 2 +- app/layout.tsx | 5 +---- app/page.tsx | 5 ++++- app/projects/page.tsx | 5 ++++- app/reading/page.tsx | 5 ++++- app/services/page.tsx | 5 ++++- app/uses/page.tsx | 5 ++++- .../page.mdx | 13 +++++++++++-- .../page.mdx | 13 +++++++++++-- .../page.mdx | 13 +++++++++++-- app/writing/page.tsx | 5 ++++- .../page.mdx | 13 +++++++++++-- .../page.mdx | 13 +++++++++++-- 14 files changed, 85 insertions(+), 22 deletions(-) diff --git a/app/about/page.tsx b/app/about/page.tsx index 6ded084..e18fe42 100644 --- a/app/about/page.tsx +++ b/app/about/page.tsx @@ -15,7 +15,10 @@ const meta = { 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' + type: 'website', + alternates: { + canonical: '/about' + } } export const metadata = _metadata({...meta, heading: meta.heading}) diff --git a/app/api/og-image/route.tsx b/app/api/og-image/route.tsx index 4445f73..1fdaeaf 100644 --- a/app/api/og-image/route.tsx +++ b/app/api/og-image/route.tsx @@ -25,7 +25,7 @@ export async function GET(request: Request) { style={{ fontSize: 64, fontFamily: 'Inter', - background: 'black', + background: '#0a0a0a', width: '100%', height: '100%', display: 'flex', diff --git a/app/layout.tsx b/app/layout.tsx index 7a1b2f7..5333114 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -11,10 +11,7 @@ export const metadata = { template: '%s - Ryan Freeman' }, description: 'Full-stack software engineer who enjoys building cloud-native applications.', - metadataBase: new URL('https://ryanfreeman.dev'), - alternates: { - canonical: '/' - } + metadataBase: new URL('https://ryanfreeman.dev') } export default function RootLayout({children}: { children: ReactNode }) { diff --git a/app/page.tsx b/app/page.tsx index 328b5c3..b4fb5a2 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -16,7 +16,10 @@ const meta = { description: '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.', - type: 'website' + type: 'website', + alternates: { + canonical: '/' + } } export const metadata = _metadata({...meta, heading: meta.heading}) diff --git a/app/projects/page.tsx b/app/projects/page.tsx index d32e42a..70110a9 100644 --- a/app/projects/page.tsx +++ b/app/projects/page.tsx @@ -11,7 +11,10 @@ const meta = { title: 'Projects', heading: 'Things I\'ve made and projects I\'ve worked on.', description: 'Here\'s a selection of academic and personal projects that I have worked on. Many of them are open-source, so if you see something that piques your interest, check out the code and contribute if you have ideas for how it can be improved.', - type: 'website' + type: 'website', + alternates: { + canonical: '/projects' + } } export const metadata = _metadata({...meta, heading: meta.heading}) diff --git a/app/reading/page.tsx b/app/reading/page.tsx index f9cebee..c0a4477 100644 --- a/app/reading/page.tsx +++ b/app/reading/page.tsx @@ -7,7 +7,10 @@ const meta = { title: 'Reading', heading: 'Books I\'m reading at the moment', description: 'Take a look at my curated reading list.', - type: 'website' + type: 'website', + alternates: { + canonical: '/reading' + } } export const metadata = _metadata({...meta, heading: meta.heading}) diff --git a/app/services/page.tsx b/app/services/page.tsx index 376051a..db64f6a 100644 --- a/app/services/page.tsx +++ b/app/services/page.tsx @@ -16,7 +16,10 @@ const meta = { heading: 'I offer a wide range of digital services to elevate and transform your business', description: 'Whether you need a WordPress website, React app, AWS support or odd coding jobs, I\'m here to help. ' + 'As an experienced software engineer, I produce high-quality software that will deliver immediate value for you and your customers.', - type: 'website' + type: 'website', + alternates: { + canonical: '/services' + } } export const metadata = _metadata({...meta, heading: meta.heading}) diff --git a/app/uses/page.tsx b/app/uses/page.tsx index ecdea03..4cd7868 100644 --- a/app/uses/page.tsx +++ b/app/uses/page.tsx @@ -8,7 +8,10 @@ const meta = { title: 'Uses', heading: 'Software I use, equipment that makes my job easier, and other things I recommend.', description: 'I get asked a lot about the things I use to build software and stay productive. Here’s a big list of all of my favourite gear.', - type: 'website' + type: 'website', + alternates: { + canonical: '/uses' + } } export const metadata = _metadata({...meta, heading: meta.heading}) diff --git a/app/writing/a-personal-journey-in-software-engineering/page.mdx b/app/writing/a-personal-journey-in-software-engineering/page.mdx index 4084012..880e59a 100644 --- a/app/writing/a-personal-journey-in-software-engineering/page.mdx +++ b/app/writing/a-personal-journey-in-software-engineering/page.mdx @@ -6,10 +6,19 @@ export const meta = { authors: 'Ryan Freeman', title: 'A personal journey in software engineering', date: '2022-12-04', - description: 'Hello there! If you\'re reading this, you\'ve likely stumbled upon my website — welcome! My name is Ryan Freeman, and I\'m a full-stack developer with a passion for creating intuitive and dynamic web applications.' + description: 'Hello there! If you\'re reading this, you\'ve likely stumbled upon my website — welcome! My name is Ryan Freeman, and I\'m a full-stack developer with a passion for creating intuitive and dynamic web applications.', + alternates: { + canonical: `/writing/${createSlug('A personal journey in software engineering')}` + } } -export const metadata = _metadata({title: meta.title, heading: meta.title, description: meta.description, type: 'article'}) +export const metadata = _metadata({ + title: meta.title, + heading: meta.title, + description: meta.description, + type: 'article', + alternates: meta.alternates +}) export default (props) =>