Skip to content

Commit

Permalink
feat: 添加 Umami 统计代码
Browse files Browse the repository at this point in the history
  • Loading branch information
baiwumm committed Jun 24, 2024
1 parent 75e080d commit bae0c54
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 2 deletions.
3 changes: 2 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ export default defineNuxtConfig({
experimental: {
viewTransition: true
},
css: ['element-plus/theme-chalk/dark/css-vars.css', '~/assets/scss/main.scss']
css: ['element-plus/theme-chalk/dark/css-vars.css', '~/assets/scss/main.scss'],
extends: ['nuxt-umami']
})
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@vue/shared": "^3.4.27",
"element-plus": "^2.7.5",
"nuxt": "^3.12.2",
"nuxt-umami": "^2.6.2",
"vue": "^3.4.21",
"vue-router": "^4.3.0"
},
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,14 @@ export default defineAppConfig({
colors: {
primary: '#ff0000'
}
},
// umami 配置
umami: {
id: '95653e90-7b8b-4541-b6de-ea5e544d8c2d',
host: 'https://umami.baiwumm.com',
useDirective: true,
version: 2,
domains: ['dream-site.cn'],
ignoreLocalhost: true
}
})
7 changes: 6 additions & 1 deletion src/components/WebsiteCard/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<template>
<el-card class="relative cursor-pointer" shadow="hover" @click="handleClick">
<el-card
v-umami="{ name: websiteInfo.name, url: websiteInfo.url }"
class="relative cursor-pointer"
shadow="hover"
@click="handleClick"
>
<div class="flex flex-col gap-3">
<div class="flex gap-2 items-center">
<el-avatar shape="square" :size="40" fit="contain" :src="websiteInfo.logo" />
Expand Down
5 changes: 5 additions & 0 deletions src/const/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ export const FooterRecord: Social[] = [
* @description: 社交图标
*/
export const FooterSocial: Social[] = [
{
icon: 'ri:bar-chart-2-line',
url: 'https://umami.baiwumm.com/share/FCiIDToq8NxwjhIJ',
tip: '网站统计'
},
{ icon: 'i-ri-github-line', url: 'https://github.com/baiwumm', tip: 'Github' },
{ icon: 'i-ri-wechat-line', url: 'https://wechat.baiwumm.com/', tip: '微信' },
{ icon: 'i-ri-mail-line', url: 'mailto:[email protected]', tip: 'Email' },
Expand Down

0 comments on commit bae0c54

Please sign in to comment.