Skip to content

Commit

Permalink
Add GA to docs
Browse files Browse the repository at this point in the history
The ID is updated based on repo variable during build action.
  • Loading branch information
nuric committed May 15, 2024
1 parent 124c42d commit 700ba91
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ jobs:
- name: Copy configuration
run: sed -i -e '/__REPLACE__/{r config/singleServer.yaml' -e 'd}' docs/content/docs/configuration.md

- name: Add GA ID from repo variables
if: ${{ vars.DOCS_GA_ID }}
run: sed -i "s/__REPLACE_GA_ID__/${{ vars.DOCS_GA_ID }}/" docs/hugo.yaml

- name: Build website
working-directory: docs
run: hugo
Expand Down
8 changes: 7 additions & 1 deletion docs/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ module:
imports:
- path: github.com/alex-shpak/hugo-book

# enableGitInfo: true
services:
googleAnalytics:
ID: "__REPLACE_GA_ID__"

privacy:
googleAnalytics:
respectDoNotTrack: true

menu:
# before: []
Expand Down

0 comments on commit 700ba91

Please sign in to comment.