diff --git a/package.json b/package.json index 7f153fc7..fe69f50e 100644 --- a/package.json +++ b/package.json @@ -82,11 +82,13 @@ "bootstrap": "^5.2.0", "classnames": "^2.3.1", "dayjs": "^1.11.3", + "journalize": "^2.5.1", "lodash-es": "^4.17.21", "lottie-web": "^5.7.13", "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", @@ -214,4 +216,4 @@ ".": "./dist/index.js" }, "svelte": "./dist/index.js" -} \ No newline at end of file +} 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..70517fcd --- /dev/null +++ b/src/components/SiteHeadline/SiteHeadline.svelte @@ -0,0 +1,231 @@ + + + +
+
+ {#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 44bbb63a..3fa5a6a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7748,6 +7748,11 @@ jest-worker@^27.4.5: merge-stream "^2.0.0" supports-color "^8.0.0" +journalize@^2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/journalize/-/journalize-2.5.1.tgz#d9c70452566e2b40f99b02b0263281c493c8c9b0" + integrity sha512-ha19m4ZiRitEsdMuwk0QMyjqTVicsJUJxz9TNkWBFJHIKAgEmXBJ8A6XR/GM1oW9fpRoGCBNLYej5U7ZdnDBMg== + js-string-escape@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/js-string-escape/-/js-string-escape-1.0.1.tgz#e2625badbc0d67c7533e9edc1068c587ae4137ef" @@ -10811,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"