From a8894aaa9bd5028063158ac8e6ec6cda91ebf677 Mon Sep 17 00:00:00 2001 From: chufan Date: Sun, 6 Oct 2024 18:13:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(@142vip/vuepress):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=BC=80=E6=BA=90=E5=8D=9A=E5=AE=A2=E7=AB=99=E7=82=B9=E7=9A=84?= =?UTF-8?q?`header`=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/vuepress/src/core/headers.ts | 37 +++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/packages/vuepress/src/core/headers.ts b/packages/vuepress/src/core/headers.ts index 4cdea1b..d62380c 100644 --- a/packages/vuepress/src/core/headers.ts +++ b/packages/vuepress/src/core/headers.ts @@ -1,7 +1,7 @@ import type { HeadConfig } from '../types' /** - * 408CSFamily + * 示例配置 */ export const exampleHeaders: HeadConfig[] = [ [ @@ -33,9 +33,26 @@ export const exampleHeaders: HeadConfig[] = [ export const FamilyHeaders: HeadConfig[] = [ [ 'link', - { rel: 'icon', href: 'fight_favicon.ico' }, + { rel: 'icon', href: '/408_favicon.ico' }, ], // vercel统计 相关配置 + + [ + 'script', + { type: 'text/javascript', src: '/_vercel/insights/script.js' }, + ], + // 百度统计 + [ + 'script', + {}, + `var _hmt = _hmt || []; + (function() { + var hm = document.createElement("script"); + hm.src = "https://hm.baidu.com/hm.js?3515cc46ae60747b778140f0e5e22dfe"; + var s = document.getElementsByTagName("script")[0]; + s.parentNode.insertBefore(hm, s); + })();`, + ], ] /** @@ -47,4 +64,20 @@ export const JSCHeaders: HeadConfig[] = [ { rel: 'icon', href: 'fight_favicon.ico' }, ], // vercel统计 相关配置 + [ + 'script', + { type: 'text/javascript', src: '/_vercel/insights/script.js' }, + ], + // 百度统计 + [ + 'script', + {}, + `var _hmt = _hmt || []; + (function() { + var hm = document.createElement("script"); + hm.src = "https://hm.baidu.com/hm.js?613c9d7af9e1c9a7f9eef6a55aa2399d"; + var s = document.getElementsByTagName("script")[0]; + s.parentNode.insertBefore(hm, s); + })();`, + ], ]