fix: remove trailing slash from path
This commit is contained in:
parent
d5a77e6aa5
commit
c489331fc7
@ -1,4 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { withoutTrailingSlash } from "ufo";
|
||||
|
||||
definePageMeta({
|
||||
documentDriven: true,
|
||||
});
|
||||
@ -6,7 +8,9 @@ definePageMeta({
|
||||
const route = useRoute();
|
||||
|
||||
const { data: page } = await useAsyncData("page-" + route.path, () => {
|
||||
return queryCollection("blog").path(route.path).first();
|
||||
return queryCollection("blog")
|
||||
.path(withoutTrailingSlash(route.path))
|
||||
.first();
|
||||
});
|
||||
|
||||
if (!page.value) {
|
||||
|
||||
1
package-lock.json
generated
1
package-lock.json
generated
@ -14,6 +14,7 @@
|
||||
"better-sqlite3": "^12.6.2",
|
||||
"nuxt": "^4.3.0",
|
||||
"tailwindcss": "^4.1.18",
|
||||
"ufo": "^1.6.3",
|
||||
"zod": "^4.3.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
"better-sqlite3": "^12.6.2",
|
||||
"nuxt": "^4.3.0",
|
||||
"tailwindcss": "^4.1.18",
|
||||
"ufo": "^1.6.3",
|
||||
"zod": "^4.3.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user