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: any;
export default _default;

View file

@ -0,0 +1,31 @@
import { createHead as createClientHead, renderDOMHead } from "@unhead/vue/client";
import { defineNuxtPlugin } from "#app/nuxt";
import unheadOptions from "#build/unhead-options.mjs";
export default defineNuxtPlugin({
name: "nuxt:head",
enforce: "pre",
setup(nuxtApp) {
const head = import.meta.server ? nuxtApp.ssrContext.head : createClientHead(unheadOptions);
nuxtApp.vueApp.use(head);
if (import.meta.client) {
let pauseDOMUpdates = true;
const syncHead = async () => {
pauseDOMUpdates = false;
await renderDOMHead(head);
};
head.hooks.hook("dom:beforeRender", (context) => {
context.shouldRender = !pauseDOMUpdates;
});
nuxtApp.hooks.hook("page:start", () => {
pauseDOMUpdates = true;
});
nuxtApp.hooks.hook("page:finish", () => {
if (!nuxtApp.isHydrating) {
syncHead();
}
});
nuxtApp.hooks.hook("app:error", syncHead);
nuxtApp.hooks.hook("app:suspense:resolve", syncHead);
}
}
});

View file

@ -0,0 +1,33 @@
import type { UseHeadInput, UseHeadOptions, VueHeadClient } from '@unhead/vue';
export type VueHeadClientPollyFill = VueHeadClient & {
/**
* @deprecated use `resolveTags`
*/
headTags: VueHeadClient['resolveTags'];
/**
* @deprecated use `push`
*/
addEntry: VueHeadClient['push'];
/**
* @deprecated use `push`
*/
addHeadObjs: VueHeadClient['push'];
/**
* @deprecated use `useHead`
*/
addReactiveEntry: (input: UseHeadInput, options?: UseHeadOptions) => (() => void);
/**
* @deprecated Use useHead API.
*/
removeHeadObjs: () => void;
/**
* @deprecated Call hook `entries:resolve` or update an entry
*/
updateDOM: () => void;
/**
* @deprecated Access unhead properties directly.
*/
unhead: VueHeadClient;
};
declare const _default: any;
export default _default;

View file

@ -0,0 +1,29 @@
import { defineNuxtPlugin } from "#app/nuxt";
import { useHead } from "#app/composables/head";
function polyfillAsVueUseHead(head) {
const polyfilled = head;
polyfilled.headTags = head.resolveTags;
polyfilled.addEntry = head.push;
polyfilled.addHeadObjs = head.push;
polyfilled.addReactiveEntry = (input, options) => {
const api = useHead(input, options);
if (api !== void 0) {
return api.dispose;
}
return () => {
};
};
polyfilled.removeHeadObjs = () => {
};
polyfilled.updateDOM = () => {
head.hooks.callHook("entries:updated", head);
};
polyfilled.unhead = head;
return polyfilled;
}
export default defineNuxtPlugin({
name: "nuxt:vueuse-head-polyfill",
setup(nuxtApp) {
polyfillAsVueUseHead(nuxtApp.vueApp._context.provides.usehead);
}
});