diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index b625be62..35b43403 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -3,6 +3,9 @@ on: pull_request: workflow_dispatch: +env: + NUXT_SITE_ENV: staging # used for NuxtSEO to disable things like indexing on staging + jobs: build_and_preview: env: diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 19ef57fa..9303be1c 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -3,6 +3,9 @@ on: push: branches: [staging] +env: + NUXT_SITE_ENV: staging # used for NuxtSEO to disable things like indexing on staging + jobs: build_and_deploy: env: diff --git a/bun.lockb b/bun.lockb index fe221d5e..e294f6d6 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/nuxt.config.ts b/nuxt.config.ts index 7be5590a..950a9aee 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -4,7 +4,7 @@ import { zksyncIcons } from './assets/zksync-icons'; // https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ extends: ['@nuxt/ui-pro'], - modules: ['@nuxt/content', '@nuxt/ui', '@nuxt/fonts', '@nuxthq/studio', 'nuxt-og-image', '@nuxt/image'], + modules: ['@nuxt/content', '@nuxt/ui', '@nuxt/fonts', '@nuxthq/studio', 'nuxt-og-image', '@nuxt/image', 'nuxt-gtag'], app: { head: { link: [{ rel: 'stylesheet', href: '/main.css' }], @@ -37,9 +37,6 @@ export default defineNuxtConfig({ { name: 'Fira Mono', provider: 'google' }, ], }, - // routeRules: { - // '/api/search.json': { prerender: true }, - // }, devtools: { enabled: true, }, @@ -78,4 +75,11 @@ export default defineNuxtConfig({ }, }, }, + $production: process.env.NUXT_SITE_ENV + ? {} + : { + gtag: { + id: 'G-QHP3K0NN1M', + }, + }, }); diff --git a/package.json b/package.json index 074797b2..70583c11 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "@nuxt/ui-pro": "^1.1.0", "dayjs": "^1.11.10", "nuxt": "^3.11.2", + "nuxt-gtag": "^2.0.6", "nuxt-og-image": "^3.0.0-rc" }, "devDependencies": {