From 2e37d39fda984b9f401f54bd9e164e3fb90337a8 Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Tue, 11 Mar 2025 12:12:23 -0700 Subject: [PATCH 1/8] updates seo --- src/components/BodyText/BodyText.mdx | 2 +- src/components/SEO/SEO.mdx | 77 ++++++++++++ src/components/SEO/SEO.stories.svelte | 48 ++------ src/components/SEO/SEO.svelte | 121 +++++++++---------- src/components/SEO/stories/docs/archieML.md | 36 ------ src/components/SEO/stories/docs/component.md | 26 ---- 6 files changed, 143 insertions(+), 167 deletions(-) create mode 100644 src/components/SEO/SEO.mdx delete mode 100644 src/components/SEO/stories/docs/archieML.md delete mode 100644 src/components/SEO/stories/docs/component.md diff --git a/src/components/BodyText/BodyText.mdx b/src/components/BodyText/BodyText.mdx index 9cd25312..1395c3a2 100644 --- a/src/components/BodyText/BodyText.mdx +++ b/src/components/BodyText/BodyText.mdx @@ -33,7 +33,7 @@ Venison shoulder *ham hock ham leberkas*. Flank beef ribs fatback, jerky meatbal With the graphics kit, you'll likely get your text value from an ArchieML doc. ```yaml -# Archie ML doc +# ArchieML doc [blocks] type: text diff --git a/src/components/SEO/SEO.mdx b/src/components/SEO/SEO.mdx new file mode 100644 index 00000000..44cd57bd --- /dev/null +++ b/src/components/SEO/SEO.mdx @@ -0,0 +1,77 @@ +import { Meta } from '@storybook/blocks'; + +import * as SEOStories from './SEO.stories.svelte'; + + + +# SEO + +The `SEO` component adds essential metadata to pages. + +```svelte + + + +``` + +## Using with ArchieML docs + +With the Graphics Kit, you'll likely get your text values from an ArchieML doc... + +```yaml +# ArchieML doc +slug: ROOT-SLUG/WILD +seoTitle: Page title for search +seoDescription: Page description for search +shareTitle: Page title for social media +shareDescription: Page description for social media +shareImgPath: images/reuters-graphics.jpg +shareImgAlt: Alt text for share image. +``` + +... which you'll pass to the `SEO` component. + +```svelte + + + +``` + +> **Note:** For _reasons_, we can't document the value of `VITE_BASE_URL` below. It's `import` + `.meta.env.BASE_URL` (concatenate all that) in the Graphics Kit and other Vite-based rigs. diff --git a/src/components/SEO/SEO.stories.svelte b/src/components/SEO/SEO.stories.svelte index e09205b5..d8fba939 100644 --- a/src/components/SEO/SEO.stories.svelte +++ b/src/components/SEO/SEO.stories.svelte @@ -1,49 +1,21 @@ - - - - - - + }} +> + View page source to see the SEO metadata. + diff --git a/src/components/SEO/SEO.svelte b/src/components/SEO/SEO.svelte index c18ae2b8..6afeb156 100644 --- a/src/components/SEO/SEO.svelte +++ b/src/components/SEO/SEO.svelte @@ -1,85 +1,72 @@ - - -``` - -> **Note:** For _reasons_, we can't document the value of `VITE_BASE_URL` below. It's `import` + `.meta.env.BASE_URL` (concatenate all that) in the Graphics Kit and other Vite-based rigs. - diff --git a/src/components/SEO/stories/docs/component.md b/src/components/SEO/stories/docs/component.md deleted file mode 100644 index 0b5c0aa2..00000000 --- a/src/components/SEO/stories/docs/component.md +++ /dev/null @@ -1,26 +0,0 @@ -The `SEO` component adds essential metadata to published pages. - -```svelte - - - -``` From b6f585f7c0faf474fe112944e6b58bdf6683a4e4 Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Tue, 11 Mar 2025 12:34:27 -0700 Subject: [PATCH 2/8] cleaned up docs --- src/components/SEO/SEO.mdx | 7 +++++-- src/components/SEO/SEO.stories.svelte | 17 +++++++++++------ src/components/SEO/SEO.svelte | 27 ++++----------------------- 3 files changed, 20 insertions(+), 31 deletions(-) diff --git a/src/components/SEO/SEO.mdx b/src/components/SEO/SEO.mdx index 44cd57bd..437f26f7 100644 --- a/src/components/SEO/SEO.mdx +++ b/src/components/SEO/SEO.mdx @@ -1,4 +1,4 @@ -import { Meta } from '@storybook/blocks'; +import { Meta, Canvas } from '@storybook/blocks'; import * as SEOStories from './SEO.stories.svelte'; @@ -21,7 +21,7 @@ The `SEO` component adds essential metadata to pages. seoTitle="A title for Google" seoDescription="A description for Google" shareTitle="A title for Twitter/Facebook" - shareDecription="A description for Twitter/Facebook" + shareDescription="A description for Twitter/Facebook" shareImgPath="https://graphics.reuters.com/world-coronavirus-tracker-and-maps/assets/images/share.jpg" shareImgAlt="An image showing global COVID infection rates" publishTime="2020-09-15T00:00:00.000Z" @@ -75,3 +75,6 @@ shareImgAlt: Alt text for share image. ``` > **Note:** For _reasons_, we can't document the value of `VITE_BASE_URL` below. It's `import` + `.meta.env.BASE_URL` (concatenate all that) in the Graphics Kit and other Vite-based rigs. + + +``` diff --git a/src/components/SEO/SEO.stories.svelte b/src/components/SEO/SEO.stories.svelte index d8fba939..967bd0dd 100644 --- a/src/components/SEO/SEO.stories.svelte +++ b/src/components/SEO/SEO.stories.svelte @@ -8,14 +8,19 @@ }); +
View page source to see the SEO metadata.
- View page source to see the SEO metadata. - +/> diff --git a/src/components/SEO/SEO.svelte b/src/components/SEO/SEO.svelte index 6afeb156..a9018264 100644 --- a/src/components/SEO/SEO.svelte +++ b/src/components/SEO/SEO.svelte @@ -7,61 +7,43 @@ interface Props { /** - * Base url for the page, which in [Vite-based projects](https://vitejs.dev/guide/build.html#public-base-path) - * is globally available as `import.meta.env.BASE_URL`. - * @requiredx - * @type {string} + * Base url for the page, which in [Vite-based projects](https://vitejs.dev/guide/build.html#public-base-path) is globally available as `import.meta.env.BASE_URL`. */ - baseUrl?: string; + baseUrl: string; /** * [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) object for the page. - * @required - * @type {URL} */ - pageUrl?: URL | null; + pageUrl: URL | null; /** * SEO title - * @required - * @type {string} */ seoTitle: string; /** * SEO description - * @required - * @type {string} */ seoDescription: string; /** * Share title - * @required - * @type {string} */ shareTitle: string; /** * Share description - * @required - * @type {string} */ shareDescription: string; /** * Share image path. **Must be an absolute path.** - * @required - * @type {string} */ shareImgPath: string; /** * Share image alt text, up to 420 characters. - * @type {string} */ shareImgAlt?: string; /** * Publish time as an [ISO string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * @type {string} */ publishTime?: string; /** * Updated time as an [ISO string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * @type {string} */ updateTime?: string; /** @@ -71,7 +53,7 @@ } let { - baseUrl = '', + baseUrl, pageUrl = null, seoTitle, seoDescription, @@ -83,7 +65,6 @@ updateTime = '', authors = [], }: Props = $props(); - const getOrigin = (baseUrl: string) => { try { return new URL(baseUrl).origin; From d715a7c2a6d796890237832588a0c4ee285b354b Mon Sep 17 00:00:00 2001 From: hobbes7878 Date: Wed, 12 Mar 2025 12:29:15 +0000 Subject: [PATCH 3/8] docs --- src/components/SEO/SEO.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/SEO/SEO.mdx b/src/components/SEO/SEO.mdx index 437f26f7..e3943ce8 100644 --- a/src/components/SEO/SEO.mdx +++ b/src/components/SEO/SEO.mdx @@ -27,15 +27,15 @@ The `SEO` component adds essential metadata to pages. publishTime="2020-09-15T00:00:00.000Z" updateTime="2021-01-10T12:30:00.000Z" authors={[ - { name: 'Jane Doe', url: 'https://twitter.com/JaneDoe' }, - { name: 'John Doe', url: 'https://twitter.com/JohnDoe' }, + { name: 'Jane Doe', link: 'https://www.reuters.com/authors/jane-doe/' }, + { name: 'John Doe', link: 'https://www.reuters.com/authors/john-doe/' }, ]} /> ``` ## Using with ArchieML docs -With the Graphics Kit, you'll likely get your text values from an ArchieML doc... +With the graphics kit, you'll likely get many of your text values from an ArchieML doc... ```yaml # ArchieML doc @@ -74,7 +74,7 @@ shareImgAlt: Alt text for share image. /> ``` -> **Note:** For _reasons_, we can't document the value of `VITE_BASE_URL` below. It's `import` + `.meta.env.BASE_URL` (concatenate all that) in the Graphics Kit and other Vite-based rigs. +> **Note:** For _reasons_, we can't document the value of `VITE_BASE_URL` below. It's `import` + `.meta.env.BASE_URL` (concatenate all that) in the graphics kit and other Vite-based rigs. ``` From 02efac9e5b947dabc9ad4e72c96ced8272dc0749 Mon Sep 17 00:00:00 2001 From: hobbes7878 Date: Wed, 12 Mar 2025 12:33:13 +0000 Subject: [PATCH 4/8] changes author url to link to align with publisher --- src/components/SEO/SEO.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/SEO/SEO.svelte b/src/components/SEO/SEO.svelte index a9018264..db63e839 100644 --- a/src/components/SEO/SEO.svelte +++ b/src/components/SEO/SEO.svelte @@ -2,7 +2,7 @@ From 6c2dc4d31e3b21657f4ca90d96ae7bd1d7c4e806 Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Wed, 12 Mar 2025 08:44:46 -0700 Subject: [PATCH 7/8] capitalise Graphics Kit in docs --- src/components/SEO/SEO.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/SEO/SEO.mdx b/src/components/SEO/SEO.mdx index e56e7ca5..1772a3be 100644 --- a/src/components/SEO/SEO.mdx +++ b/src/components/SEO/SEO.mdx @@ -35,7 +35,7 @@ The `SEO` component adds essential metadata to pages. ## Using with ArchieML docs -With the graphics kit, you'll likely get many of your text values from an ArchieML doc... +With the Graphics Kit, you'll likely get many of your text values from an ArchieML doc... ```yaml # ArchieML doc @@ -74,7 +74,7 @@ shareImgAlt: Alt text for share image. /> ``` -> **Note:** For _reasons_, we can't document the value of `VITE_BASE_URL` below. It's `import` + `.meta.env.BASE_URL` (concatenate all that) in the graphics kit and other Vite-based rigs. +> **Note:** For _reasons_, we can't document the value of `VITE_BASE_URL` below. It's `import` + `.meta.env.BASE_URL` (concatenate all that) in the Graphics Kit and other Vite-based rigs. ``` From b1aa5326e8b5d2a8131654f1a0ab7d71bc732f79 Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Wed, 12 Mar 2025 09:20:38 -0700 Subject: [PATCH 8/8] seo prop tweaks --- .../ReutersGraphicsLogo/ReutersGraphicsLogo.svelte | 9 +++++---- src/components/SEO/SEO.svelte | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/ReutersGraphicsLogo/ReutersGraphicsLogo.svelte b/src/components/ReutersGraphicsLogo/ReutersGraphicsLogo.svelte index 6fe397dc..cb6e31bc 100644 --- a/src/components/ReutersGraphicsLogo/ReutersGraphicsLogo.svelte +++ b/src/components/ReutersGraphicsLogo/ReutersGraphicsLogo.svelte @@ -1,8 +1,5 @@