Skip to content

Commit 8e1ff82

Browse files
refactor: remove UUID resolver
1 parent 25fd513 commit 8e1ff82

File tree

4 files changed

+4
-42
lines changed

4 files changed

+4
-42
lines changed

components/Kirby/UuidResolver.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

pages/[...slug].vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
44
import { getPageQuery } from '~/queries'
55
6-
const { locale } = useI18n()
6+
const { locale, localeCodes } = useI18n()
77
const route = useRoute()
88
9-
// Use current slug or fall back to the homepage
10-
const pageUri = getNonLocalizedSlug(
11-
route.params.slug,
12-
useKirbyStaticData().languages,
13-
)
9+
// Extract the non-localized slug
10+
const pageUri = getNonLocalizedSlug(route.params.slug, localeCodes.value)
1411
1512
const { data: pageData, error: pageError } = await useKql(
1613
getPageQuery(pageUri || 'home'),

queries/about.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ export const aboutQuery: KirbyQuerySchema = {
3434
email: true,
3535
phone: true,
3636
social: 'page.social.toStructure',
37-
// Retrieve all images from the page to resolve a UUID from
38-
// e.g. a structure field to a file object
39-
// images: {
40-
// query: 'page.files.template("image")',
41-
// select: ['uuid', 'srcset', 'width', 'height', 'alt'],
42-
// },
4337
...sharedQuerySelects,
4438
},
4539
}

utils/locale.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function getNonLocalizedSlug(
1616
if (Array.isArray(param)) {
1717
param = param.filter(Boolean)
1818

19-
// If the first item is a locale, remove it
19+
// Remove locale prefix if present
2020
if (param.length > 0 && locales.includes(param[0])) {
2121
param = param.slice(1)
2222
}

0 commit comments

Comments
 (0)