Support Cloudflare Web Analytics

This commit is contained in:
Mimi 2020-12-24 11:22:24 +08:00
parent 9b1320fea4
commit 12a7328f3f
4 changed files with 8 additions and 5 deletions

View File

@ -15,8 +15,4 @@ jobs:
This issue has been automatically marked as stale because lack of This issue has been automatically marked as stale because lack of
recent activity. It will be closed if no further activity occurs. Thank you recent activity. It will be closed if no further activity occurs. Thank you
for your contributions. You can also use our [support channels](https://github.com/next-theme/hexo-theme-next#feedback) to get help with the project. for your contributions. You can also use our [support channels](https://github.com/next-theme/hexo-theme-next#feedback) to get help with the project.
exempt-issue-labels: exempt-issue-labels: Bug,Feature Request,Discussion,Help Wanted
- Bug
- Feature Request
- Discussion
- Help Wanted

View File

@ -670,6 +670,9 @@ baidu_analytics: # <app_id>
# Growingio Analytics # Growingio Analytics
growingio_analytics: # <project_id> growingio_analytics: # <project_id>
# Cloudflare Web Analytics
cloudflare_analytics:
# Show number of visitors of each article. # Show number of visitors of each article.
# You can visit https://www.leancloud.cn to get AppID and AppKey. # You can visit https://www.leancloud.cn to get AppID and AppKey.
leancloud_visitors: leancloud_visitors:

View File

@ -0,0 +1,3 @@
{%- if theme.cloudflare_analytics %}
<script{{ pjax }} defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "{{ theme.cloudflare_analytics }}"}'></script>
{%- endif %}

View File

@ -1,3 +1,4 @@
{%- include 'google-analytics.njk' -%} {%- include 'google-analytics.njk' -%}
{%- include 'baidu-analytics.njk' -%} {%- include 'baidu-analytics.njk' -%}
{%- include 'growingio.njk' -%} {%- include 'growingio.njk' -%}
{%- include 'cloudflare.njk' -%}