feat: more attributes
This commit is contained in:
parent
98158089c3
commit
af85336a31
@ -41,7 +41,13 @@ In the `bibliography.json` file, add sources like this:
|
||||
}
|
||||
```
|
||||
|
||||
Each source can have a url, a title or both.
|
||||
Each source can have the following attributes:
|
||||
|
||||
* `title` (mandatory)
|
||||
* `url`
|
||||
* `author`
|
||||
* `accessed` (the date you've accessed the source)
|
||||
* `date` (the date the source was published)
|
||||
|
||||
In your slides, reference a source like this:
|
||||
|
||||
|
@ -9,17 +9,35 @@ const bib = computed(() => {
|
||||
return [...bibliography.sources]
|
||||
.map(key => Bibliography[key])
|
||||
})
|
||||
|
||||
const props = defineProps({
|
||||
accessedTitle: {
|
||||
default: 'accessed',
|
||||
type: String,
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<ul>
|
||||
<li v-for="s in bib">
|
||||
<template v-if="typeof s.author !== 'undefined' && s.author !== ''">
|
||||
{{ s.author }},
|
||||
</template>
|
||||
|
||||
{{ s.title }}
|
||||
|
||||
<template v-if="s.date !== '' && typeof s.date !== 'undefined'">
|
||||
, ({{ s.date }})
|
||||
</template>
|
||||
|
||||
<template v-if="s.url !== '' && typeof s.url !== 'undefined'">
|
||||
<a :href="s.url">
|
||||
{{ s.title === '' || typeof s.title === 'undefined' ? s.url : s.title }}
|
||||
{{ s.url }}
|
||||
</a>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ s.title }}
|
||||
|
||||
<template v-if="s.accessed !== '' && typeof s.accessed !== 'undefined'">
|
||||
({{ accessedTitle }} {{ s.accessed }})
|
||||
</template>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -15,7 +15,7 @@
|
||||
"author": "kolaente",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@slidev/cli": "^0.37.1",
|
||||
"@slidev/cli": "^0.43.15",
|
||||
"postcss": "^8.4.19"
|
||||
}
|
||||
}
|
||||
|
4269
pnpm-lock.yaml
generated
4269
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user