From ad61eb558f5e60a3b7ac8ff9cfcd782a4267b5b3 Mon Sep 17 00:00:00 2001 From: Jon McClure Date: Mon, 12 Sep 2022 22:47:59 +0100 Subject: [PATCH] suggested changes --- package.json | 1 + .../HeadlineBreakingNews.svelte | 153 ------------ .../HeadlineNreakingNews.stories.svelte | 93 -------- .../stories/docs/component.md | 12 - .../stories/docs/quickit.md | 47 ---- .../stories/docs/withByline.md | 20 -- .../SiteHeadline/SiteHeadline.stories.svelte | 66 ++++++ .../SiteHeadline/SiteHeadline.svelte | 223 ++++++++++++++++++ .../SiteHeadline/stories/docs/component.md | 11 + .../SiteHeadline/stories/docs/quickit.md | 28 +++ yarn.lock | 5 + 11 files changed, 334 insertions(+), 325 deletions(-) delete mode 100644 src/components/HeadlineBreakingNews/HeadlineBreakingNews.svelte delete mode 100644 src/components/HeadlineBreakingNews/HeadlineNreakingNews.stories.svelte delete mode 100644 src/components/HeadlineBreakingNews/stories/docs/component.md delete mode 100644 src/components/HeadlineBreakingNews/stories/docs/quickit.md delete mode 100644 src/components/HeadlineBreakingNews/stories/docs/withByline.md create mode 100644 src/components/SiteHeadline/SiteHeadline.stories.svelte create mode 100644 src/components/SiteHeadline/SiteHeadline.svelte create mode 100644 src/components/SiteHeadline/stories/docs/component.md create mode 100644 src/components/SiteHeadline/stories/docs/quickit.md diff --git a/package.json b/package.json index 297457b4..fe69f50e 100644 --- a/package.json +++ b/package.json @@ -88,6 +88,7 @@ "marked": "^4.0.8", "proper-url-join": "^2.1.1", "pym.js": "^1.3.2", + "slugify": "^1.6.5", "svelte-fa": "^2.4.0", "svelte-intersection-observer": "^0.10.0", "svelte-search": "^2.0.1", diff --git a/src/components/HeadlineBreakingNews/HeadlineBreakingNews.svelte b/src/components/HeadlineBreakingNews/HeadlineBreakingNews.svelte deleted file mode 100644 index 6869e28b..00000000 --- a/src/components/HeadlineBreakingNews/HeadlineBreakingNews.svelte +++ /dev/null @@ -1,153 +0,0 @@ - - - -
-
- {#if section} -

- {#if sectionUrl} - {section} - {:else} - {section} - {/if} -

- {/if} - {#if hed} -

{@html marked.parseInline(hed)}

- {/if} -
- {#if $$slots.byline || $$slots.dateline} - - {/if} -
-
- - diff --git a/src/components/HeadlineBreakingNews/HeadlineNreakingNews.stories.svelte b/src/components/HeadlineBreakingNews/HeadlineNreakingNews.stories.svelte deleted file mode 100644 index c1dff89a..00000000 --- a/src/components/HeadlineBreakingNews/HeadlineNreakingNews.stories.svelte +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - By Peppa Pig - - Published - - - - - - By {@html marked.parseInline(content.Byline)} -
- Published - {#if content.Updated} -
Updated - - {/if} -
-
-
- - diff --git a/src/components/HeadlineBreakingNews/stories/docs/component.md b/src/components/HeadlineBreakingNews/stories/docs/component.md deleted file mode 100644 index 6b70611c..00000000 --- a/src/components/HeadlineBreakingNews/stories/docs/component.md +++ /dev/null @@ -1,12 +0,0 @@ -Reuters Graphics headline for breaking news pages - -This is a simplified version of the `Headline` component. It doesn't allow for the addition of crown, the dek is removed, and the styles are -simplified. It is meant to serve as a unifying style for quick turnaround pages. - -```svelte - - - -``` diff --git a/src/components/HeadlineBreakingNews/stories/docs/quickit.md b/src/components/HeadlineBreakingNews/stories/docs/quickit.md deleted file mode 100644 index 1c60d0a0..00000000 --- a/src/components/HeadlineBreakingNews/stories/docs/quickit.md +++ /dev/null @@ -1,47 +0,0 @@ -Setup your Google Doc to work with the `HeadlineBreakingNews` component. - -```yaml -# Beginning of your Google doc -Kicker: Global News -KickerUrl: -Hed: A beautiful page -Byline: Sherlock Holmes -Published: 2022-09-12T08:30:00.000Z -Updated: -MarginBottom: 2rem -``` - -Note that this works in exactly the same way as the `Headline` component, but for the extra prop of `KickerUrl` which you need to add if -you don't want your kicker to be a link to Reuters Graphics. You can also additionally have a `MarginBottom` prop. - -```svelte - - - - - By {@html marked.parseInline(content.Byline)} -
- Published - {#if content.Updated} -
Updated - - {/if} -
-
-``` diff --git a/src/components/HeadlineBreakingNews/stories/docs/withByline.md b/src/components/HeadlineBreakingNews/stories/docs/withByline.md deleted file mode 100644 index 1d25c4dc..00000000 --- a/src/components/HeadlineBreakingNews/stories/docs/withByline.md +++ /dev/null @@ -1,20 +0,0 @@ -Add a byline and dateline with `byline` and `dateline` named slots. -If you don't want to display 'Global Graphics' with a link to graphics.reuters.com at the top, you can -replace with a section title using the `section` prop and leaving the `sectionUrl` blank. - -```svelte - - - - - By Peppa Pig - - Published Jan. 1, 2020 - -``` diff --git a/src/components/SiteHeadline/SiteHeadline.stories.svelte b/src/components/SiteHeadline/SiteHeadline.stories.svelte new file mode 100644 index 00000000..495b0647 --- /dev/null +++ b/src/components/SiteHeadline/SiteHeadline.stories.svelte @@ -0,0 +1,66 @@ + + + + + + + + + + + + + diff --git a/src/components/SiteHeadline/SiteHeadline.svelte b/src/components/SiteHeadline/SiteHeadline.svelte new file mode 100644 index 00000000..8c38a1e0 --- /dev/null +++ b/src/components/SiteHeadline/SiteHeadline.svelte @@ -0,0 +1,223 @@ + + + +
+
+ {#if section} +

+ {#if sectionUrl} + {section} + {:else} + {section} + {/if} +

+ {/if} + {#if hed} +

{hed}

+ {/if} +
+ +
+
+ + diff --git a/src/components/SiteHeadline/stories/docs/component.md b/src/components/SiteHeadline/stories/docs/component.md new file mode 100644 index 00000000..d0e18795 --- /dev/null +++ b/src/components/SiteHeadline/stories/docs/component.md @@ -0,0 +1,11 @@ +A simplified Reuters Graphics headline, loosely modelled off our dotcom site. + +Styles for this headline are intentionally restricted. It is meant to serve as a unifying style for quick-turnaround, usually shorter breaking news pages. + +```svelte + + + +``` diff --git a/src/components/SiteHeadline/stories/docs/quickit.md b/src/components/SiteHeadline/stories/docs/quickit.md new file mode 100644 index 00000000..2520bd1a --- /dev/null +++ b/src/components/SiteHeadline/stories/docs/quickit.md @@ -0,0 +1,28 @@ +Setup your Google Doc to work with the `SiteHeadline` component. + +```yaml +# Beginning of your Google doc +Section: Global News +SectionUrl: +Hed: A beautiful page +Authors: Samuel Granados, Dea Bankova +Published: 2022-09-12T08:30:00.000Z +Updated: +``` + +```svelte + + + + +``` diff --git a/yarn.lock b/yarn.lock index ef3cfe67..3fa5a6a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10816,6 +10816,11 @@ slice-ansi@^2.1.0: astral-regex "^1.0.0" is-fullwidth-code-point "^2.0.0" +slugify@^1.6.5: + version "1.6.5" + resolved "https://registry.yarnpkg.com/slugify/-/slugify-1.6.5.tgz#c8f5c072bf2135b80703589b39a3d41451fbe8c8" + integrity sha512-8mo9bslnBO3tr5PEVFzMPIWwWnipGS0xVbYf65zxDqfNwmzYn1LpiKNrR6DlClusuvo+hDHd1zKpmfAe83NQSQ== + snake-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c"