Skip to content

Commit 5f44cdb

Browse files
committed
Stop Using Fonts.
1 parent bc59259 commit 5f44cdb

File tree

2 files changed

+35
-35
lines changed

2 files changed

+35
-35
lines changed

.vitepress/config/common-config.ts

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -142,41 +142,41 @@ export const commonConfig :UserConfig<DefaultTheme.Config> = {
142142
}
143143
},
144144
ignoreDeadLinks: true,
145-
transformHead({ assets }) {
146-
const preloadLinks = [];
145+
// transformHead({ assets }) {
146+
// const preloadLinks = [];
147147

148-
const scFontFile = assets.find(file => /HarmonyOS_Sans_SC_Regular\.[\w-]+\.ttf/.test(file));
149-
console.log(scFontFile);
150-
if (scFontFile) {
151-
preloadLinks.push([
152-
'link',
153-
{
154-
rel: 'preload',
155-
href: scFontFile,
156-
as: 'font',
157-
type: 'font/ttf',
158-
crossorigin: ''
159-
}
160-
]);
161-
}
148+
// const scFontFile = assets.find(file => /HarmonyOS_Sans_SC_Regular\.[\w-]+\.ttf/.test(file));
149+
// console.log(scFontFile);
150+
// if (scFontFile) {
151+
// preloadLinks.push([
152+
// 'link',
153+
// {
154+
// rel: 'preload',
155+
// href: scFontFile,
156+
// as: 'font',
157+
// type: 'font/ttf',
158+
// crossorigin: ''
159+
// }
160+
// ]);
161+
// }
162162

163-
const tcFontFile = assets.find(file => /HarmonyOS_Sans_TC_Regular\.[\w-]+\.ttf/.test(file));
164-
if (tcFontFile) {
165-
preloadLinks.push([
166-
'link',
167-
{
168-
rel: 'preload',
169-
href: tcFontFile,
170-
as: 'font',
171-
type: 'font/ttf',
172-
crossorigin: ''
173-
}
174-
]);
175-
}
163+
// const tcFontFile = assets.find(file => /HarmonyOS_Sans_TC_Regular\.[\w-]+\.ttf/.test(file));
164+
// if (tcFontFile) {
165+
// preloadLinks.push([
166+
// 'link',
167+
// {
168+
// rel: 'preload',
169+
// href: tcFontFile,
170+
// as: 'font',
171+
// type: 'font/ttf',
172+
// crossorigin: ''
173+
// }
174+
// ]);
175+
// }
176176

177-
return [
178-
...preloadLinks,
179-
["link", { rel: "icon", href: "https://docs.mihono.cn/favicon.ico" }],
180-
];
181-
},
177+
// return [
178+
// ...preloadLinks,
179+
// ["link", { rel: "icon", href: "https://docs.mihono.cn/favicon.ico" }],
180+
// ];
181+
// },
182182
}

.vitepress/theme/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ts-nocheck
22
import { h } from "vue";
33
import type { Theme } from "vitepress";
4-
import DefaultTheme from 'vitepress/theme-without-fonts'
4+
import DefaultTheme from 'vitepress/theme'
55
import vitepressNprogress from "vitepress-plugin-nprogress";
66
import { useData, useRoute, inBrowser } from "vitepress";
77
import "./styles/index.css";

0 commit comments

Comments
 (0)