-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't render analytics with mkdocs serve
- Loading branch information
Showing
1 changed file
with
18 additions
and
10 deletions.
There are no files selected for viewing
28 changes: 18 additions & 10 deletions
28
docs/overrides/partials/integrations/analytics/simpleanalytics.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
<!-- Simple Analytics - 100% privacy-first analytics --> | ||
<script async defer | ||
src="https://{{ config.extra.analytics.script_domain | default('scripts.simpleanalyticscdn.com')}}/latest.js" | ||
data-collect-dnt="true" | ||
data-hostname="{{ config.extra.analytics.hostname }}"></script> | ||
<noscript> | ||
<img src="https://{{ config.extra.analytics.noscript_domain | default('queue.simpleanalyticscdn.com' )}}/noscript.gif?collect-dnt={{ config.extra.analytics.collect_dnt }}&hostname={{ config.extra.analytics.hostname }}&path={{ page.url }}" | ||
alt="" | ||
referrerpolicy="no-referrer-when-downgrade"> | ||
</noscript> | ||
{% set site_domain = config.site_url | replace('https://', '') | replace('http://', '') | trim('/') %} | ||
{% set dev_domain = config.dev_addr | replace('https://', '') | replace('http://', '') | trim('/') %} | ||
{% set develop = site_domain.startswith(dev_domain) %} | ||
{% if not develop %} | ||
{% set hostname = config.extra.analytics.hostname | default(site_domain) %} | ||
{% set script_domain = config.extra.analytics.script_domain | default('scripts.simpleanalyticscdn.com') %} | ||
{% set noscript_domain = config.extra.analytics.noscript_domain | default('queue.simpleanalyticscdn.com') %} | ||
{% set collect_dnt = config.extra.analytics.collect_dnt | default('false') %} | ||
<script async defer | ||
src="https://{{ script_domain }}/latest.js" | ||
data-collect-dnt="true" | ||
data-hostname="{{ hostname }}"></script> | ||
<noscript> | ||
<img src="https://{{ noscript_domain }}/noscript.gif?collect-dnt={{ collect_dnt }}&hostname={{ hostname }}&path={{ page.url }}" | ||
alt="" | ||
referrerpolicy="no-referrer-when-downgrade"> | ||
</noscript> | ||
{% endif %} |