2025-03-14 18:01:48 +08:00
|
|
|
import path from "path"; // ✅ 先引入 path 模块
|
2025-03-27 14:40:36 +08:00
|
|
|
|
2025-03-11 13:58:21 +08:00
|
|
|
export default {
|
|
|
|
|
// Global page headers: https://go.nuxtjs.dev/config-head
|
|
|
|
|
head: {
|
2025-03-27 14:40:36 +08:00
|
|
|
title: 'buddysCloud',
|
2025-04-16 19:09:05 +08:00
|
|
|
script: [
|
|
|
|
|
{
|
|
|
|
|
src: 'https://www.googletagmanager.com/gtag/js?id=G-PMXV6BN06E',
|
|
|
|
|
async: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
innerHTML: `
|
|
|
|
|
window.dataLayer = window.dataLayer || [];
|
|
|
|
|
function gtag(){dataLayer.push(arguments);}
|
|
|
|
|
gtag('js', new Date());
|
|
|
|
|
gtag('config', 'G-PMXV6BN06E');
|
|
|
|
|
`,
|
|
|
|
|
type: 'text/javascript',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
__dangerouslyDisableSanitizers: ['script'], // 允许内联脚本
|
2025-03-11 13:58:21 +08:00
|
|
|
htmlAttrs: {
|
|
|
|
|
lang: 'en'
|
|
|
|
|
},
|
|
|
|
|
meta: [
|
|
|
|
|
{ charset: 'utf-8' },
|
|
|
|
|
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
|
|
|
|
{ hid: 'description', name: 'description', content: '' },
|
|
|
|
|
{ name: 'format-detection', content: 'telephone=no' }
|
|
|
|
|
],
|
|
|
|
|
link: [
|
|
|
|
|
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
|
2025-03-27 14:40:36 +08:00
|
|
|
],
|
2025-03-11 13:58:21 +08:00
|
|
|
},
|
2025-03-14 18:01:48 +08:00
|
|
|
serverMiddleware: [
|
|
|
|
|
{ path: "/api/news", handler: path.resolve(__dirname, "server/readNews.js") }
|
|
|
|
|
],
|
2025-03-11 13:58:21 +08:00
|
|
|
// Global CSS: https://go.nuxtjs.dev/config-css
|
|
|
|
|
css: [
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
|
|
|
|
|
plugins: [
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
// Auto import components: https://go.nuxtjs.dev/config-components
|
|
|
|
|
components: true,
|
|
|
|
|
|
|
|
|
|
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
|
|
|
|
|
buildModules: [
|
|
|
|
|
],
|
2025-03-14 18:01:48 +08:00
|
|
|
content: {
|
|
|
|
|
// ✅ 配置 Markdown 目录
|
|
|
|
|
dir: "static/news",
|
|
|
|
|
},
|
2025-03-11 13:58:21 +08:00
|
|
|
// Modules: https://go.nuxtjs.dev/config-modules
|
|
|
|
|
modules: [
|
|
|
|
|
// https://go.nuxtjs.dev/bootstrap
|
|
|
|
|
'bootstrap-vue/nuxt',
|
2025-03-14 18:01:48 +08:00
|
|
|
'@nuxt/content',
|
2025-03-27 14:40:36 +08:00
|
|
|
'@nuxtjs/axios',
|
2025-04-16 19:09:05 +08:00
|
|
|
// '@nuxtjs/google-analytics'
|
|
|
|
|
'@nuxtjs/gtm'
|
2025-03-11 13:58:21 +08:00
|
|
|
],
|
2025-04-16 19:09:05 +08:00
|
|
|
// buildModules:[
|
|
|
|
|
// '@nuxtjs/google-analytics'
|
|
|
|
|
// ],
|
2025-04-15 20:14:33 +08:00
|
|
|
gtm: {
|
2025-04-16 19:09:05 +08:00
|
|
|
id: 'GTM-PL75JP66',
|
2025-04-15 20:14:33 +08:00
|
|
|
layer: 'dataLayer',
|
2025-04-16 19:09:05 +08:00
|
|
|
pageTracking: false, // ✅ 关闭 GTM 的自动页面跟踪,避免和 GA 冲突
|
2025-04-15 20:14:33 +08:00
|
|
|
enabled: true
|
|
|
|
|
// enabled: process.env.NODE_ENV === 'production'
|
|
|
|
|
},
|
2025-04-16 19:09:05 +08:00
|
|
|
// googleAnalytics: {
|
|
|
|
|
// id: 'G-PMXV6BN06E',
|
|
|
|
|
// debug: true,
|
|
|
|
|
// autoTracking: {
|
|
|
|
|
// screenview: true, // GA 自己管理页面跟踪
|
|
|
|
|
// },
|
|
|
|
|
// },
|
2025-03-11 13:58:21 +08:00
|
|
|
// Build Configuration: https://go.nuxtjs.dev/config-build
|
|
|
|
|
build: {
|
|
|
|
|
}
|
|
|
|
|
}
|