This commit is contained in:
itcsx committed 2026-09-22 23:09:11 +08:00
1 parent 4adae1bd7d
commit adcf94df4a
17 files changed
+274 -97

No files matched your search

+14
View File
@@ -35,9 +35,23 @@ async function setupApp() {
// 初始化 i18n
await setupI18n(app);
setupShareImage();
app.mount("#app");
}
/**
* 分享卡片(微信收藏/转发等)的缩略图要求绝对地址,相对路径会被忽略,
* 这里按当前域名把 index.html 里的 og:image 补全。
*/
function setupShareImage() {
const meta = document.querySelector('meta[property="og:image"]');
const content = meta?.getAttribute("content");
if (meta && content && !/^https?:\/\//i.test(content)) {
meta.setAttribute("content", new URL(content, location.origin).href);
}
}
setupPlugins();
setupApp();