fix
This commit is contained in:
parent
b7ae338e59
commit
595735b1a4
|
|
@ -1,21 +1,11 @@
|
||||||
import { g } from "./global";
|
// import { g } from "./global";
|
||||||
|
|
||||||
const preload: string[] = [];
|
// const preload: string[] = [];
|
||||||
|
|
||||||
export const prodIndex = (
|
export const prodIndex = (
|
||||||
site_id: string,
|
site_id: string,
|
||||||
prasi: { page_id?: string; params?: any }
|
prasi: { page_id?: string; params?: any }
|
||||||
) => {
|
) => {
|
||||||
if (preload.length === 0) {
|
|
||||||
Object.keys(g.deploy.content?.code.core || {})
|
|
||||||
.filter((e) => e.endsWith(".woff") || e.endsWith(".woff2"))
|
|
||||||
.forEach((e) => {
|
|
||||||
preload.push(
|
|
||||||
` <link rel="preload" href="/${e}" as="font" crossorigin="anonymous">`
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
head: [] as string[],
|
head: [] as string[],
|
||||||
body: [] as string[],
|
body: [] as string[],
|
||||||
|
|
@ -31,7 +21,6 @@ export const prodIndex = (
|
||||||
<link rel="stylesheet" href="/index.css">
|
<link rel="stylesheet" href="/index.css">
|
||||||
<link rel="stylesheet" href="/main.css">
|
<link rel="stylesheet" href="/main.css">
|
||||||
${this.head.join("\n")}
|
${this.head.join("\n")}
|
||||||
${preload.join("\n")}
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="flex-col flex-1 w-full min-h-screen flex opacity-0">
|
<body class="flex-col flex-1 w-full min-h-screen flex opacity-0">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue