diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index fd7057e5..6c990691 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -37,6 +37,16 @@ const { imageUrl, title } = Astro.props; const canonicalURL = Astro.props.canonicalURL ?? new URL(Astro.url.pathname, Astro.site); const description = Astro.props.description ?? starpodConfig.description; + +// The show's profiles elsewhere, so agents can connect this site to the same +// entity on other platforms (JSON-LD sameAs). +const sameAs = [ + starpodConfig.platforms.apple, + starpodConfig.platforms.spotify, + starpodConfig.platforms.youtube, + starpodConfig.platforms.overcast, + starpodConfig.platforms.pocketCasts +].filter((url): url is string => Boolean(url)); --- @@ -108,15 +118,22 @@ const description = Astro.props.description ?? starpodConfig.description; description: show.description, url: canonicalURL.toString(), webFeed: starpodConfig.rssFeed, + sameAs, author: { '@type': 'Organization', name: show.title, - url: canonicalURL.origin + description: starpodConfig.description, + url: canonicalURL.origin, + logo: show.image, + sameAs }, publisher: { '@type': 'Organization', name: show.title, - url: canonicalURL.origin + description: starpodConfig.description, + url: canonicalURL.origin, + logo: show.image, + sameAs }, image: show.image }} diff --git a/src/pages/contact.astro b/src/pages/contact.astro index 37404e5f..02846c35 100644 --- a/src/pages/contact.astro +++ b/src/pages/contact.astro @@ -1,6 +1,18 @@ --- import Layout from '../layouts/Layout.astro'; import ContactForm from '../components/ContactForm'; +import { getShowInfo } from '../lib/rss'; +import starpodConfig from 'starpod.config'; + +const show = await getShowInfo(); + +const platformLinks = [ + { name: 'Apple Podcasts', url: starpodConfig.platforms.apple }, + { name: 'Spotify', url: starpodConfig.platforms.spotify }, + { name: 'YouTube', url: starpodConfig.platforms.youtube }, + { name: 'Overcast', url: starpodConfig.platforms.overcast }, + { name: 'Pocket Casts', url: starpodConfig.platforms.pocketCasts } +].filter((platform) => platform.url); --- @@ -12,10 +24,93 @@ import ContactForm from '../components/ContactForm';

- Have a question for us or a topic you would like us to cover on the show? - Reach out here and we'll be in touch soon! + Have a question for us, feedback on an episode, or a topic you would like + us to cover on {show.title}? Maybe a guest you want to hear from, or just + something you want to say? Fill out the form below and your message goes + straight to the hosts — we read every one and we'll be in touch soon!

+ +
+

+ Reach the hosts directly +

+ +
    + { + starpodConfig.hosts.map((host) => ( +
  • + {host.name} + {host.twitter && ( + <> + {' — '} + + Twitter + + + )} + {host.github && ( + <> + {' · '} + + GitHub + + + )} + {host.website && ( + <> + {' · '} + + Website + + + )} +
  • + )) + } +
+ + { + platformLinks.length > 0 && ( + <> +

+ Follow the show +

+

+ The best way to support {show.title} is to subscribe, leave a + review, and share episodes with your friends. You can find us on: +

+ + + ) + } +
diff --git a/tests/e2e/trust-identity.spec.ts b/tests/e2e/trust-identity.spec.ts new file mode 100644 index 00000000..fb7ba351 --- /dev/null +++ b/tests/e2e/trust-identity.spec.ts @@ -0,0 +1,37 @@ +import { expect, test } from '@playwright/test'; + +test.describe('JSON-LD identity', () => { + test('homepage JSON-LD carries full Organization identity', async ({ + page + }) => { + await page.goto('/'); + + const jsonLd = await page + .locator('script[type="application/ld+json"]') + .first() + .textContent(); + const schema = JSON.parse(jsonLd!); + + expect(schema['@type']).toBe('PodcastSeries'); + expect(schema.publisher['@type']).toBe('Organization'); + expect(schema.publisher.url).toBeTruthy(); + expect(schema.publisher.logo).toBeTruthy(); + expect(schema.publisher.sameAs.length).toBeGreaterThan(0); + }); +}); + +test.describe('contact trust page', () => { + test('has substantive contact content beyond the form', async ({ page }) => { + await page.goto('/contact'); + + await expect( + page.getByRole('heading', { name: 'Get in touch' }) + ).toBeVisible(); + await expect( + page.getByRole('heading', { name: 'Reach the hosts directly' }) + ).toBeVisible(); + await expect( + page.getByRole('heading', { name: 'Follow the show' }) + ).toBeVisible(); + }); +});