谷歌分析
This commit is contained in:
1 parent
1327988568
commit
8043b687a7
1 file changed
+77
-77
@@ -1,88 +1,88 @@
|
|||||||
import { defineConfig, type SiteConfig } from 'vitepress'
|
import {defineConfig, type SiteConfig} from 'vitepress'
|
||||||
// 自动导入 TDesign
|
// 自动导入 TDesign
|
||||||
import AutoImport from 'unplugin-auto-import/vite'
|
import AutoImport from 'unplugin-auto-import/vite'
|
||||||
import Components from 'unplugin-vue-components/vite'
|
import Components from 'unplugin-vue-components/vite'
|
||||||
import { TDesignResolver } from 'unplugin-vue-components/resolvers'
|
import {TDesignResolver} from 'unplugin-vue-components/resolvers'
|
||||||
|
|
||||||
import { handleHeadMeta } from '../theme/utils/handleHeadMeta'
|
import {handleHeadMeta} from '../theme/utils/handleHeadMeta'
|
||||||
import { search as zhSearch } from './zh'
|
import {search as zhSearch} from './zh'
|
||||||
import sidebar from '../../../autoSidebar'
|
import sidebar from '../../../autoSidebar'
|
||||||
|
|
||||||
// https://vitepress.dev/reference/site-config
|
// https://vitepress.dev/reference/site-config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
lastUpdated: true,
|
lastUpdated: true,
|
||||||
cleanUrls: true,
|
cleanUrls: true,
|
||||||
ignoreDeadLinks: true,
|
ignoreDeadLinks: true,
|
||||||
sitemap: {
|
sitemap: {
|
||||||
hostname: 'https://duyl328.github.io',
|
hostname: 'https://duyl328.github.io',
|
||||||
},
|
|
||||||
// base: 'https://duyl328.github.io',
|
|
||||||
base: process.env.BASE || '/',
|
|
||||||
head: [
|
|
||||||
// 谷歌分析,暂不使用
|
|
||||||
// ['script',
|
|
||||||
// {
|
|
||||||
// async: '',
|
|
||||||
// src: 'https://www.googletagmanager.com/gtag/js?id=G-MB7XVBG1TQ',
|
|
||||||
// }],
|
|
||||||
// [
|
|
||||||
// 'script',
|
|
||||||
// {},
|
|
||||||
// `window.dataLayer = window.dataLayer || [];
|
|
||||||
// function gtag(){dataLayer.push(arguments);}
|
|
||||||
// gtag('js', new Date());
|
|
||||||
// gtag('config', 'G-MB7XVBG1TQ');`,
|
|
||||||
// ],
|
|
||||||
|
|
||||||
[
|
|
||||||
'link',
|
|
||||||
{
|
|
||||||
rel: 'icon',
|
|
||||||
// href: '',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
// https://vitepress.dev/reference/site-config#transformhead
|
|
||||||
async transformHead (context) {
|
|
||||||
return handleHeadMeta(context)
|
|
||||||
},
|
|
||||||
buildEnd: (config: SiteConfig) => {
|
|
||||||
},
|
|
||||||
|
|
||||||
themeConfig: {
|
|
||||||
// https://vitepress.dev/reference/default-theme-config
|
|
||||||
outline: [2, 4],
|
|
||||||
|
|
||||||
search: {
|
|
||||||
provider: 'local',
|
|
||||||
options: {
|
|
||||||
locales: { ...zhSearch },
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
// base: 'https://duyl328.github.io',
|
||||||
externalLinkIcon: true,
|
base: process.env.BASE || '/',
|
||||||
},
|
head: [
|
||||||
|
// 谷歌分析,暂不使用
|
||||||
markdown: {
|
['script',
|
||||||
math: true,
|
{
|
||||||
},
|
async: 'async',
|
||||||
|
src: 'https://www.googletagmanager.com/gtag/js?id=G-E6X527581S',
|
||||||
vite: {
|
}],
|
||||||
plugins: [
|
[
|
||||||
// 自动更新列表
|
'script',
|
||||||
sidebar('docs/.vitepress', '/docs/notes'),
|
{},
|
||||||
AutoImport({
|
`window.dataLayer = window.dataLayer || [];
|
||||||
resolvers: [
|
function gtag(){dataLayer.push(arguments);}
|
||||||
TDesignResolver({
|
gtag('js', new Date());
|
||||||
library: 'vue-next',
|
gtag('config', 'G-E6X527581S');`,
|
||||||
})],
|
],
|
||||||
}),
|
|
||||||
Components({
|
[
|
||||||
resolvers: [
|
'link',
|
||||||
TDesignResolver({
|
{
|
||||||
library: 'vue-next',
|
rel: 'icon',
|
||||||
})],
|
// href: '',
|
||||||
}),
|
},
|
||||||
|
],
|
||||||
],
|
],
|
||||||
},
|
// https://vitepress.dev/reference/site-config#transformhead
|
||||||
|
async transformHead(context) {
|
||||||
|
return handleHeadMeta(context)
|
||||||
|
},
|
||||||
|
buildEnd: (config: SiteConfig) => {
|
||||||
|
},
|
||||||
|
|
||||||
|
themeConfig: {
|
||||||
|
// https://vitepress.dev/reference/default-theme-config
|
||||||
|
outline: [2, 4],
|
||||||
|
|
||||||
|
search: {
|
||||||
|
provider: 'local',
|
||||||
|
options: {
|
||||||
|
locales: {...zhSearch},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
externalLinkIcon: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
markdown: {
|
||||||
|
math: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
vite: {
|
||||||
|
plugins: [
|
||||||
|
// 自动更新列表
|
||||||
|
sidebar('docs/.vitepress', '/docs/notes'),
|
||||||
|
AutoImport({
|
||||||
|
resolvers: [
|
||||||
|
TDesignResolver({
|
||||||
|
library: 'vue-next',
|
||||||
|
})],
|
||||||
|
}),
|
||||||
|
Components({
|
||||||
|
resolvers: [
|
||||||
|
TDesignResolver({
|
||||||
|
library: 'vue-next',
|
||||||
|
})],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
})
|
})
|
||||||
Reference in new issue
Block a user