feat: enhance loading time (hom.custom.md) and prefetching

Fix part of #330
This commit is contained in:
ShareVB committed 2026-04-19 11:34:03 +02:00
1 parent ee94dc9d07
commit 4178707ee5
2 files changed
+16 -6

No files matched your search

+6
View File
@@ -12,6 +12,12 @@
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png" />
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#18a058" />
<link rel="preload" href="home.custom.md" as="fetch" />
<link rel="preload" href="tools-filter.json" as="fetch" />
<link rel="preload" href="external-tools.json" as="fetch" />
<link rel="preload" href="tools-settings.json" as="fetch" />
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#ffffff" />
+10 -6
View File
@@ -14,12 +14,6 @@ const base = import.meta.env.BASE_URL ?? '/';
const homeCustomMarkdown = ref('');
fetch(`${base}home.custom.md`).then((r) => {
if (r.ok) {
r.text().then(t => homeCustomMarkdown.value = t);
}
});
const { t } = useI18n();
const toolStore = useToolStore();
@@ -127,6 +121,16 @@ onMounted(() => {
);
loadingObserver.observe(loadingIndicator);
}
fetch(`${base}home.custom.md`).then((r) => {
if (r.ok) {
r.text().then((t) => {
if (t) {
homeCustomMarkdown.value = t;
}
});
}
});
});
});