Skip to content

Commit 8362564

Browse files
authored
refactor(core): remove GA page views report (#1071)
- Google Analytics superProxy has been archived and is no longer maintained. - Google Analytics UA end of life. See also: https://support.google.com/analytics/answer/11583528?hl=en
1 parent 728094d commit 8362564

File tree

13 files changed

+2
-552
lines changed

13 files changed

+2
-552
lines changed

_config.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ google_site_verification: # fill in to your verification string
5454

5555
google_analytics:
5656
id: # fill in your Google Analytics ID
57-
# Google Analytics pageviews report settings
58-
pv:
59-
proxy_endpoint: # fill in the Google Analytics superProxy endpoint of Google App Engine
60-
cache_path: # the local PV cache data, friendly to visitors from GFW region
6157

6258
# Prefer color scheme setting.
6359
#

_data/origin/basic.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ dayjs:
3131
relativeTime: /assets/lib/dayjs/plugin/relativeTime.min.js
3232
localizedFormat: /assets/lib/dayjs/plugin/localizedFormat.min.js
3333

34-
countup:
35-
js: /assets/lib/countup.js/countUp.min.js
36-
3734
magnific-popup:
3835
css: /assets/lib/magnific-popup/magnific-popup.css
3936
js: /assets/lib/magnific-popup/jquery.magnific-popup.min.js

_data/origin/cors.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ dayjs:
4242
relativeTime: https://cdn.jsdelivr.net/npm/dayjs@1.11.7/plugin/relativeTime.min.js
4343
localizedFormat: https://cdn.jsdelivr.net/npm/dayjs@1.11.7/plugin/localizedFormat.min.js
4444

45-
countup:
46-
js: https://cdn.jsdelivr.net/npm/countup.js@1.9.3/dist/countUp.min.js
47-
4845
magnific-popup:
4946
css: https://cdn.jsdelivr.net/npm/magnific-popup@1.1.0/dist/magnific-popup.min.css
5047
js: https://cdn.jsdelivr.net/npm/magnific-popup@1.1.0/dist/jquery.magnific-popup.min.js

_includes/head.html

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,6 @@
1111
content="width=device-width, user-scalable=no initial-scale=1, shrink-to-fit=no, viewport-fit=cover"
1212
>
1313

14-
{% if page.layout == 'home' or page.layout == 'post' %}
15-
{% if site.google_analytics.pv.proxy_endpoint %}
16-
<meta name="pv-proxy-endpoint" content="{{ site.google_analytics.pv.proxy_endpoint }}">
17-
{% endif %}
18-
19-
{% if site.google_analytics.pv.cache_path %}
20-
<meta name="pv-cache-path" content="{{ site.google_analytics.pv.cache_path | relative_url }}">
21-
{% endif %}
22-
{% endif %}
23-
2414
{% capture seo_tags %}
2515
{% seo title=false %}
2616
{% endcapture %}
@@ -76,17 +66,6 @@
7666

7767
<link rel="preconnect" href="https://www.googletagmanager.com" crossorigin="anonymous">
7868
<link rel="dns-prefetch" href="https://www.googletagmanager.com">
79-
80-
{% if site.google_analytics.pv.proxy_endpoint %}
81-
{% assign proxy_url = site.google_analytics.pv.proxy_endpoint
82-
| replace: 'https://', ''
83-
| split: '/'
84-
| first
85-
| prepend: 'https://'
86-
%}
87-
<link rel="preconnect" href="{{ proxy_url }}" crossorigin="use-credentials">
88-
<link rel="dns-prefetch" href="{{ proxy_url }}">
89-
{% endif %}
9069
{% endif %}
9170

9271
<!-- Bootstrap -->

_includes/js-selector.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@
1111

1212
<!-- layout specified -->
1313

14-
{% if page.layout == 'post' %}
15-
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
16-
<!-- pv-report needs countup.js -->
17-
{% assign urls = urls | append: ',' | append: site.data.origin[type].countup.js %}
18-
{% endif %}
19-
{% endif %}
20-
2114
{% if page.layout == 'post' or page.layout == 'page' or page.layout == 'home' %}
2215
{% assign urls = urls | append: ',' | append: site.data.origin[type].lazysizes.js %}
2316

_javascript/modules/components/pageviews.js

Lines changed: 0 additions & 248 deletions
This file was deleted.

_javascript/modules/plugins.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ export { initClipboard } from './components/clipboard';
33
export { imgLazy } from './components/img-lazyload';
44
export { imgPopup } from './components/img-popup';
55
export { initLocaleDatetime } from './components/locale-datetime';
6-
export { initPageviews } from './components/pageviews';
76
export { toc } from './components/toc';

_javascript/post.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
imgPopup,
55
initLocaleDatetime,
66
initClipboard,
7-
initPageviews,
87
toc
98
} from './modules/plugins';
109

@@ -16,4 +15,3 @@ imgPopup();
1615
initLocaleDatetime();
1716
initClipboard();
1817
toc();
19-
initPageviews();

_layouts/post.html

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,6 @@ <h1 data-toc-skip>{{ page.title }}</h1>
7171
</span>
7272

7373
<div>
74-
<!-- page views -->
75-
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
76-
<span>
77-
<em id="pv" class="pageviews">
78-
<i class="fas fa-spinner fa-spin fa-fw"></i>
79-
</em>
80-
{{ site.data.locales[lang].post.pageview_measure }}
81-
</span>
82-
{% endif %}
83-
8474
<!-- read time -->
8575
{% include read-time.html content=content prompt=true lang=lang %}
8676
</div>

0 commit comments

Comments
 (0)