Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(@142vip/vuepress): 增加开源博客站点的header配置 #151

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions packages/vuepress/src/core/headers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { HeadConfig } from '../types'

/**
* 408CSFamily
* 示例配置
*/
export const exampleHeaders: HeadConfig[] = [
[
Expand Down Expand Up @@ -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);
})();`,
],
]

/**
Expand All @@ -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);
})();`,
],
]