mirror of https://github.com/luizdepra/hugo-coder.git

Wil Kong
15.50.2023 5616919fcb1567b09749e436a95c5e69955c3879
Update Doc About Baidu Analytics (#809)

### 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

Update documentation about using Baidu analytics in this 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
- [ ] 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
1 files modified
1 files added
28 ■■■■■ changed files
docs/analytics.md 3 ●●●● patch | view | raw | blame | history
docs/analytics/baidu.md 25 ●●●●● patch | view | raw | blame | history
docs/analytics.md
@@ -5,6 +5,7 @@
*in alphabetic order*
* [Application Insights](https://azure.com/) - [documentation](/docs/analytics/applicationinsights.md)
* [Baidu Analytics](https://tongji.baidu.com/) - [documentation](/docs/analytics/baidu.md)
* [Cloudflare](https://www.cloudflare.com/analytics/) - [documentation](/docs/analytics/cloudflare.md)
* [Google Analytics](https://developers.google.com/analytics) - [documentation](/docs/analytics/googleanalytics.md)
* [Google Tag Manager](https://developers.google.com/tag-manager) - [documentation](/docs/analytics/googletagmanager.md)
@@ -15,4 +16,4 @@
* [Pirsch](https://pirsch.io/) - [documentation](/docs/analytics/pirsch.md)
* [Plausible Analytics](https://plausible.io/) - [documentation](/docs/analytics/plausible.md)
* [Umami](https://umami.is/) - [documentation](/docs/analytics/umami.md)
* [Wide Angle Analytics](https://wideangle.co/) - [documentation](/docs/analytics/wideangle.md)
* [Wide Angle Analytics](https://wideangle.co/) - [documentation](/docs/analytics/wideangle.md)
docs/analytics/baidu.md
New file
@@ -0,0 +1,25 @@
# Baidu
To use Baidu analytics in this theme, navigate to the setting page of your
site at <https://tongji.baidu.com/>. You will get a piece of JS code provided
as follows:
```js
<script>
var _hmt = _hmt || [];
(function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?<your_token_at_here>";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();
</script>
```
Then you can use it by filling your site toke `your_token_at_here` in the
config file:
```toml
[params.baidu]
    token = "your_token_at_here"
```