Website Structure

This commit is contained in:
supalerk-ar66 2026-01-13 10:46:40 +07:00
parent 62812f2090
commit 71f0676a62
22365 changed files with 4265753 additions and 791 deletions

View file

@ -0,0 +1,2 @@
declare const _default: import("../composables/router.js").RouteMiddleware;
export default _default;

View file

@ -0,0 +1,17 @@
import { hasProtocol } from "ufo";
import { defineNuxtRouteMiddleware } from "../composables/router.js";
import { getRouteRules } from "../composables/manifest.js";
export default defineNuxtRouteMiddleware(async (to) => {
if (import.meta.server || import.meta.test) {
return;
}
const rules = await getRouteRules({ path: to.path });
if (rules.redirect) {
const path = rules.redirect.includes("#") ? rules.redirect : rules.redirect + to.hash;
if (hasProtocol(path, { acceptRelative: true })) {
window.location.href = path;
return false;
}
return path;
}
});