diff --git a/.vscode/astrowind/config-schema.json b/.vscode/astrowind/config-schema.json index a26ab83..22fd20f 100644 --- a/.vscode/astrowind/config-schema.json +++ b/.vscode/astrowind/config-schema.json @@ -241,6 +241,10 @@ "properties": { "id": { "type": "string" + }, + "partytown": { + "type": "boolean", + "default": true } }, "required": ["id"] diff --git a/astro.config.mjs b/astro.config.mjs index 5721218..7e3db13 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -17,7 +17,7 @@ import { SITE_CONFIG, ANALYTICS_CONFIG } from './src/utils/config.ts'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const whenExternalScripts = (items = []) => - ANALYTICS_CONFIG.vendors.googleAnalytics.id + ANALYTICS_CONFIG.vendors.googleAnalytics.id && ANALYTICS_CONFIG.vendors.googleAnalytics.partytown ? Array.isArray(items) ? items.map((item) => item()) : [items()] @@ -33,7 +33,7 @@ export default defineConfig({ integrations: [ tailwind({ - applyBaseStyles: false + applyBaseStyles: false, }), sitemap(), image({ diff --git a/src/components/common/Analytics.astro b/src/components/common/Analytics.astro index 99cee15..b8670ac 100644 --- a/src/components/common/Analytics.astro +++ b/src/components/common/Analytics.astro @@ -5,6 +5,6 @@ import { ANALYTICS_CONFIG } from '~/utils/config'; { ANALYTICS_CONFIG?.vendors?.googleAnalytics?.id ? ( - + ) : null } diff --git a/src/utils/config.ts b/src/utils/config.ts index 838a583..487081a 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -2,7 +2,7 @@ import fs from 'fs'; import yaml from 'js-yaml'; import merge from 'lodash.merge'; -import type { MetaSEO } from '~/types'; +import type { MetaData } from '~/types'; export interface SiteConfig { name: string; @@ -11,7 +11,7 @@ export interface SiteConfig { trailingSlash?: boolean; googleSiteVerificationId?: string; } -export interface MetaDataConfig extends Omit { +export interface MetaDataConfig extends Omit { title?: { default: string; template: string; @@ -61,8 +61,8 @@ export interface AppBlogConfig { export interface AnalyticsConfig { vendors: { googleAnalytics: { - isEnabled?: boolean; id?: string; + partytown?: boolean; }; }; } @@ -187,8 +187,8 @@ const getAnalytics = () => { const _default = { vendors: { googleAnalytics: { - isEnabled: false, id: undefined, + partytown: true, }, }, };