refactor: migrate to nuxt compatibilityVersion: 4 (#3298)
This commit is contained in:
parent
46e4433e1c
commit
a3fbc056a9
342 changed files with 1200 additions and 2932 deletions
25
app/pages/[...permalink].vue
Normal file
25
app/pages/[...permalink].vue
Normal file
|
@ -0,0 +1,25 @@
|
|||
<script setup lang="ts">
|
||||
import { hasProtocol, parseURL } from 'ufo'
|
||||
|
||||
definePageMeta({
|
||||
middleware: async (to) => {
|
||||
const permalink = Array.isArray(to.params.permalink)
|
||||
? to.params.permalink.join('/')
|
||||
: to.params.permalink
|
||||
|
||||
if (hasProtocol(permalink)) {
|
||||
const { host, pathname } = parseURL(permalink)
|
||||
|
||||
if (host)
|
||||
return `/${host}${pathname}`
|
||||
}
|
||||
|
||||
// We've reached a page that doesn't exist
|
||||
return false
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div />
|
||||
</template>
|
Loading…
Add table
Add a link
Reference in a new issue