From a4c14c95abe26c569ada9342c373450ab9870d87 Mon Sep 17 00:00:00 2001 From: Scott Scoble Date: Sun, 3 May 2026 01:14:38 -0700 Subject: [PATCH] =?UTF-8?q?Resolve=20merge=20conflicts=20=E2=80=94=20keep?= =?UTF-8?q?=20stashed=20improvements=20(SEO,=20sitemap)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SEO.astro | 207 +++++++++++++++++++++++---------------- src/pages/sitemap.xml.ts | 37 ++++--- 2 files changed, 138 insertions(+), 106 deletions(-) diff --git a/src/components/SEO.astro b/src/components/SEO.astro index 792c205..5aad4c6 100644 --- a/src/components/SEO.astro +++ b/src/components/SEO.astro @@ -1,10 +1,10 @@ --- -interface SEOProps { +interface Props { title: string; description: string; ogImage?: string; ogType?: string; - url?: string; + canonicalUrl?: string; pageType?: 'home' | 'speaking' | 'books' | 'consulting' | 'contact' | 'blog'; } @@ -18,115 +18,150 @@ const { } = Astro.props; const siteUrl = 'https://scott.scoble.me'; +const currentPath = canonicalUrl || Astro.url.pathname; const fullTitle = title.includes('Scott Scoble') ? title : `${title} — Scott Scoble`; const imageUrl = new URL(ogImage, siteUrl).href; -const pageUrl = canonicalUrl ? new URL(canonicalUrl, siteUrl).href : `${siteUrl}${Astro.url.pathname}`; +const pageUrl = new URL(currentPath, siteUrl).href; -// Build JSON-LD based on page type -const person = { - '@type': 'Person', - '@id': `${siteUrl}#person`, - name: 'Scott Scoble', - givenName: 'Scott', - familyName: 'Scoble', - jobTitle: 'Human Cultivation Expert', - url: siteUrl, - email: 'mailto:scott@scoble.me', - sameAs: [ - 'https://linkedin.com/in/scottscoble', - 'https://x.com/scottscoble', - 'https://github.com/sscoble', - ], -}; +// JSON-LD structured data +function getJsonLd(pageType: string): string { + const personLd = { + '@type': 'Person', + '@id': `${siteUrl}#person`, + name: 'Scott Scoble', + givenName: 'Scott', + familyName: 'Scoble', + jobTitle: 'Human Cultivation Expert', + url: siteUrl, + email: 'mailto:scott@scoble.me', + sameAs: [ + 'https://linkedin.com/in/scottscoble', + 'https://x.com/scottscoble', + 'https://github.com/sscoble', + ], + }; -const website = { - '@type': 'WebSite', - '@id': `${siteUrl}#website`, - name: 'Scott Scoble', - description: 'Human Cultivation Expert for the AI Age', - url: siteUrl, -}; + switch (pageType) { + case 'home': { + const websiteLd = { + '@type': 'WebSite', + '@id': `${siteUrl}#website`, + name: 'Scott Scoble', + description: 'Human Cultivation Expert for the AI Age', + url: siteUrl, + }; + return JSON.stringify([personLd, websiteLd], null, 2); + } -let jsonLd: any; -switch (pageType) { - case 'home': - jsonLd = [person, website]; - break; - case 'speaking': - jsonLd = { - ...person, - '@id': `${siteUrl}#speaker`, - jobTitle: 'Keynote Speaker', - description: 'Human Cultivation Expert speaking on AI, leadership, and team cultivation', - }; - break; - case 'books': - jsonLd = [ - { - '@type': 'Book', - name: 'The Soil Beneath the Code', - author: { '@type': 'Person', name: 'Scott Scoble' }, - datePublished: '2023', - bookFormat: 'EBook, Hardcover', - }, - { - '@type': 'Book', - name: 'A Walk in Mentoring', - author: { '@type': 'Person', name: 'Scott Scoble' }, - datePublished: '2024', - bookFormat: 'EBook, Paperback', - }, - ]; - break; - case 'consulting': - jsonLd = { - '@type': 'Service', - name: 'AI Team Consulting', - description: 'Helping leaders build AI systems that cultivate humans instead of strip-mining them', - provider: { '@type': 'Person', name: 'Scott Scoble' }, - serviceType: 'Professional Consulting', - areaServed: 'Worldwide', - }; - break; - case 'contact': - jsonLd = { - '@type': 'ContactPoint', - email: 'scott@scoble.me', - contactType: 'Customer Service', - availableLanguage: 'English', - }; - break; - case 'blog': - default: - jsonLd = { - '@type': 'Blog', - name: 'Scott Scoble Blog', - description: 'Thoughts on AI, leadership, and human cultivation', - url: `${siteUrl}/blog`, - }; - break; + case 'speaking': + return JSON.stringify({ + '@type': 'Person', + '@id': `${siteUrl}#speaker`, + name: 'Scott Scoble', + jobTitle: 'Keynote Speaker', + description: 'Human Cultivation Expert speaking on AI, leadership, and team cultivation', + url: siteUrl, + sameAs: personLd.sameAs, + }, null, 2); + + case 'books': + return JSON.stringify([ + { + '@type': 'Book', + name: 'The Soil Beneath the Code', + author: 'Scott Scoble', + datePublished: '2023', + bookFormat: 'EBook, Hardcover', + }, + { + '@type': 'Book', + name: 'A Walk in Mentoring', + author: 'Scott Scoble', + datePublished: '2024', + bookFormat: 'EBook, Paperback', + }, + { + '@type': 'Book', + name: 'Dark Provenance', + author: 'Scott Scoble', + datePublished: '2026', + bookFormat: 'EBook, Hardcover', + }, + ], null, 2); + + case 'consulting': + return JSON.stringify({ + '@type': 'Service', + name: 'AI Team Consulting', + description: 'Helping leaders build AI systems that cultivate humans instead of strip-mining them', + provider: { '@type': 'Person', name: 'Scott Scoble' }, + serviceType: 'Professional Consulting', + areaServed: 'Worldwide', + offering: [ + { + '@type': 'Offering', + name: 'Keynote Speaking', + description: '45-60 minute keynotes on AI, leadership, and team cultivation', + }, + { + '@type': 'Offering', + name: 'Workshops', + description: 'Half-day or full-day workshops on cultivation practices', + }, + ], + }, null, 2); + + case 'contact': + return JSON.stringify({ + '@type': 'ContactPoint', + email: 'scott@scoble.me', + contactType: 'Customer Service', + availableLanguage: 'English', + }, null, 2); + + default: + return JSON.stringify({ + '@type': 'Blog', + name: 'Scott Scoble Blog', + description: 'Thoughts on AI, leadership, and human cultivation', + url: `${siteUrl}/blog`, + }, null, 2); + } } + +const jsonLd = getJsonLd(pageType); --- + +{fullTitle} - + + + + + -