chore: support services.googleAnalytics.ID (#173)

* chore: support `services.googleAnalytics.ID`

and deprecate `site.googleAnalytics`

* chore: remove warning
This commit is contained in:
Xin
2023-10-30 19:48:48 -04:00
committed by GitHub
parent de1286c7fc
commit e3f6069968
4 changed files with 16 additions and 6 deletions

View File

@ -252,8 +252,10 @@ excludeSearch: true
### Google Analytics
To enable Google Analytics, set the `googleAnalytics` parameter in the config file:
To enable [Google Analytics](https://marketingplatform.google.com/about/analytics/), set `services.googleAnalytics.ID` flag in `hugo.yaml`:
```yaml {filename="hugo.yaml"}
googleAnalytics: G-XXXXXXXXXX
services:
googleAnalytics:
ID: G-MEASUREMENT_ID
```

View File

@ -7,7 +7,9 @@ enableGitInfo: true
# enableEmoji: false
hasCJKLanguage: true
# googleAnalytics: G-XXXXXXXXXX
# services:
# googleAnalytics:
# ID: G-MEASUREMENT_ID
outputs:
home: [HTML]