Add custom slugs support and simplify work URL

This commit is contained in:
Michael Winter 2026-04-26 10:31:11 +02:00
parent 2fb7c6aafd
commit d34ea209f7
2 changed files with 4 additions and 1 deletions

View file

@ -103,7 +103,9 @@ const { data: works } = await useFetch('/api/works', {
const work = computed(() => { const work = computed(() => {
if (!works.value) return null if (!works.value) return null
return works.value.find(w => slugify(w.title) === slug) return works.value.find(w =>
(w.slug && w.slug === slug) || slugify(w.title) === slug
)
}) })
const year = computed(() => { const year = computed(() => {

View file

@ -1716,6 +1716,7 @@
{ {
"id": "QmkLEQND4lD4", "id": "QmkLEQND4lD4",
"title": "for sirens perhaps, and/or ... (compact sets 4 - alarming)", "title": "for sirens perhaps, and/or ... (compact sets 4 - alarming)",
"slug": "for_sirens_perhaps_and_or",
"instrument_tags": [ "instrument_tags": [
"sirens and/or sustaining instruments" "sirens and/or sustaining instruments"
], ],