mirror of
https://github.com/elk-zone/elk.git
synced 2024-12-21 03:43:11 +03:00
25 lines
505 B
Vue
25 lines
505 B
Vue
<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>
|