Add Baidu Analytics (#808)
### Prerequisites
Put an `x` into the box(es) that apply:
- [ ] This pull request fixes a bug.
- [x] This pull request adds a feature.
- [ ] This pull request introduces breaking change.
### Description
Add Baidu Analytics (<https://tongji.baidu.com/>) to the theme.
### Issues Resolved
List any existing issues this pull request resolves.
### Checklist
Put an `x` into the box(es) that apply:
#### General
- [x] Describe what changes are being made
- [x] Explain why and how the changes were necessary and implemented
respectively
- [ ] Reference issue with `#<ISSUE_NO>` if applicable
#### Resources
- [ ] If you have changed any SCSS code, run `make release` to
regenerate all CSS files
#### Contributors
- [x] Add yourself to `CONTRIBUTORS.md` if you aren't on it already
3 files modified
1 files added
| | |
| | | - [Jaroslaw Rozanski](https://jarekrozanski.eu) |
| | | - [Easton Man](https://github.com/eastonman) |
| | | - [Yiğit Altınay](https://altinay.xyz) |
| | | - [Fei Kong](https://github.com/alpha0422) |
| | |
| | | # [params.cloudflare] |
| | | # token = "token" |
| | | |
| | | # If you want to use Baidu Analytics(https://tongji.baidu.com) for analytics, add this section |
| | | # [params.baidu] |
| | | # token = "token" |
| | | |
| | | # If you want to use Matomo(https://matomo.org) for analytics, add this section |
| | | # [params.matomo] |
| | | # siteID = "ABCDE" # Default value is "1", overwrite this if you are cloud-hosting |
| | |
| | | {{- partial "analytics/cloudflare" . -}} |
| | | {{ end }} |
| | | |
| | | {{ if and .Site.Params.baidu .Site.Params.baidu.token }} |
| | | {{- partial "analytics/baidu" . -}} |
| | | {{ end }} |
| | | |
| | | {{ if and .Site.Params.wideAngleAnalytics .Site.Params.wideAngleAnalytics.siteID }} |
| | | {{- partial "analytics/wideangle" . -}} |
| | | {{ end }} |
| | |
| | | {{- partial "body/extensions" . -}} |
| | | </body> |
| | | |
| | | </html> |
| | | </html> |
| New file |
| | |
| | | <!-- Baidu Analytics --> |
| | | <script> |
| | | var _hmt = _hmt || []; |
| | | (function() { |
| | | var hm = document.createElement("script"); |
| | | hm.src = "https://hm.baidu.com/hm.js?{{ $.Site.Params.baidu.token }}"; |
| | | var s = document.getElementsByTagName("script")[0]; |
| | | s.parentNode.insertBefore(hm, s); |
| | | })(); |
| | | </script> |
| | | <!-- End Baidu Web Analytics --> |