From 81e63b256559d54f14495162cc1001761ad2431e Mon Sep 17 00:00:00 2001 From: Melissa Huang Date: Mon, 5 Feb 2024 19:49:13 -0800 Subject: [PATCH] try google tag id --- .github/workflows/gh-pages.yml | 10 ++++++---- config.toml | 5 +---- .../ghostwriter/layouts/partials/analytics-gtag.html | 6 +++--- themes/ghostwriter/layouts/partials/header.html | 4 +--- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 4c90295..c74b128 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -3,7 +3,7 @@ name: github pages on: push: branches: - - master # Set a branch that will trigger a deployment + - master # Set a branch that will trigger a deployment pull_request: jobs: @@ -12,13 +12,13 @@ jobs: steps: - uses: actions/checkout@v3 with: - submodules: true # Fetch Hugo themes (true OR recursive) - fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod + submodules: true # Fetch Hugo themes (true OR recursive) + fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod - name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: 'latest' + hugo-version: "latest" # extended: true - name: Build @@ -30,3 +30,5 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./public + env: + GOOGLE_ANALYTICS_ID: ${{ secrets.GOOGLE_ANALYTICS_ID }} diff --git a/config.toml b/config.toml index 6943690..22fec81 100644 --- a/config.toml +++ b/config.toml @@ -17,7 +17,4 @@ weight = 1 [[menu.main]] name = "About" url = "/pages/about" -weight = 2 - -[[Analytics]] -googleAnalyticsID = "G-3YJ9SZ6HYY" \ No newline at end of file +weight = 2 \ No newline at end of file diff --git a/themes/ghostwriter/layouts/partials/analytics-gtag.html b/themes/ghostwriter/layouts/partials/analytics-gtag.html index ad64807..8e08a54 100644 --- a/themes/ghostwriter/layouts/partials/analytics-gtag.html +++ b/themes/ghostwriter/layouts/partials/analytics-gtag.html @@ -1,9 +1,9 @@ - + \ No newline at end of file diff --git a/themes/ghostwriter/layouts/partials/header.html b/themes/ghostwriter/layouts/partials/header.html index c9ca241..ea723c3 100644 --- a/themes/ghostwriter/layouts/partials/header.html +++ b/themes/ghostwriter/layouts/partials/header.html @@ -24,9 +24,7 @@ {{ partial "exponea.html" . }} {{ partial "fathom.html" . }} {{ partial "plausible.html" . }} - {{ if .Site.Params.googleAnalyticsID }} - {{ partial "analytics-gtag.html" . }} - {{ end }} + {{ partial "analytics-gtag.html" . }} {{ template "_internal/google_analytics.html" . }}