updates dependencies, adds examples to docs
This commit is contained in:
parent
93c07569e3
commit
f03ef9e2dc
3 changed files with 8 additions and 6 deletions
|
|
@ -6,7 +6,7 @@ import * as BylineStories from './Byline.stories.svelte';
|
||||||
|
|
||||||
# Byline
|
# Byline
|
||||||
|
|
||||||
Easily add a byline and dateline to your story.
|
The `Byline` component adds a byline, published and updated datelines to your page.
|
||||||
|
|
||||||
```svelte
|
```svelte
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -25,9 +25,11 @@ Easily add a byline and dateline to your story.
|
||||||
/>
|
/>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Cutom byline, published and updated datelines
|
<Canvas of={BylineStories.Demo} />
|
||||||
|
|
||||||
You can customise the byline, published and updated datelines using [snippets](https://svelte.dev/docs/svelte/snippet), which are the Svelte 5 version of slots. You can pass any string or html as snippets.
|
## Cutomisation
|
||||||
|
|
||||||
|
Use [snippets](https://svelte.dev/docs/svelte/snippet) to customise the byline, published and updated datelines.
|
||||||
|
|
||||||
```svelte
|
```svelte
|
||||||
<Byline publishTime="2021-09-12T00:00:00Z" updateTime="2021-09-12T13:57:00Z">
|
<Byline publishTime="2021-09-12T00:00:00Z" updateTime="2021-09-12T13:57:00Z">
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Story name="Customised">
|
<Story name="Customised" tags={['!autodocs', '!dev']}>
|
||||||
<Byline publishTime="2021-09-12T00:00:00Z" updateTime="2021-09-12T13:57:00Z">
|
<Byline publishTime="2021-09-12T00:00:00Z" updateTime="2021-09-12T13:57:00Z">
|
||||||
{#snippet byline()}
|
{#snippet byline()}
|
||||||
<strong>BY REUTERS GRAPHICS</strong>
|
<strong>BY REUTERS GRAPHICS</strong>
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,8 @@
|
||||||
|
|
||||||
let {
|
let {
|
||||||
authors = [],
|
authors = [],
|
||||||
publishTime = '',
|
publishTime,
|
||||||
updateTime = '',
|
updateTime,
|
||||||
align = 'left',
|
align = 'left',
|
||||||
id = '',
|
id = '',
|
||||||
cls = '',
|
cls = '',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue