diff --git a/src/components/Byline/Byline.mdx b/src/components/Byline/Byline.mdx index dbff6ad5..94106e99 100644 --- a/src/components/Byline/Byline.mdx +++ b/src/components/Byline/Byline.mdx @@ -58,7 +58,7 @@ updateTime: 2021-09-12T12:57:00.000Z -## Cutomisation +## Custom byline, published and updated datelines Use [snippets](https://svelte.dev/docs/svelte/snippet) to customise the byline, published and updated datelines. @@ -82,3 +82,25 @@ Use [snippets](https://svelte.dev/docs/svelte/snippet) to customise the byline, ``` + +## Custom author page + +By default, the `Byline` component will hyperlink each author's byline to their Reuters.com page, formatted `https://www.reuters.com/authors/{author-slug}/`. + +To hyperlink to different pages or email addresses, pass a custom function to the `getAuthorPage` prop. + +```svelte + + { + return `mailto:${author.replace(' ', '')}@example.com`; + }} +/> + +``` + + +```` diff --git a/src/components/Byline/Byline.stories.svelte b/src/components/Byline/Byline.stories.svelte index c0cf796a..6a81142a 100644 --- a/src/components/Byline/Byline.stories.svelte +++ b/src/components/Byline/Byline.stories.svelte @@ -18,7 +18,6 @@ + + { + return `mailto:${author.replace(' ', '')}@example.com`; + }, + }} +/> diff --git a/src/components/Byline/Byline.svelte b/src/components/Byline/Byline.svelte index c904e27f..fa8e2558 100644 --- a/src/components/Byline/Byline.svelte +++ b/src/components/Byline/Byline.svelte @@ -1,8 +1,8 @@ ``` -## Dek - -```svelte - - - -``` - -## With byline +## With authors and publish time ```svelte