Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core): remove GA page views report #1071

Merged
merged 1 commit into from
Jun 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ google_site_verification: # fill in to your verification string

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

# Prefer color scheme setting.
#
Expand Down
3 changes: 0 additions & 3 deletions _data/origin/basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ dayjs:
relativeTime: /assets/lib/dayjs/plugin/relativeTime.min.js
localizedFormat: /assets/lib/dayjs/plugin/localizedFormat.min.js

countup:
js: /assets/lib/countup.js/countUp.min.js

magnific-popup:
css: /assets/lib/magnific-popup/magnific-popup.css
js: /assets/lib/magnific-popup/jquery.magnific-popup.min.js
Expand Down
3 changes: 0 additions & 3 deletions _data/origin/cors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ dayjs:
relativeTime: https://cdn.jsdelivr.net/npm/[email protected]/plugin/relativeTime.min.js
localizedFormat: https://cdn.jsdelivr.net/npm/[email protected]/plugin/localizedFormat.min.js

countup:
js: https://cdn.jsdelivr.net/npm/[email protected]/dist/countUp.min.js

magnific-popup:
css: https://cdn.jsdelivr.net/npm/[email protected]/dist/magnific-popup.min.css
js: https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.magnific-popup.min.js
Expand Down
21 changes: 0 additions & 21 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@
content="width=device-width, user-scalable=no initial-scale=1, shrink-to-fit=no, viewport-fit=cover"
>

{% if page.layout == 'home' or page.layout == 'post' %}
{% if site.google_analytics.pv.proxy_endpoint %}
<meta name="pv-proxy-endpoint" content="{{ site.google_analytics.pv.proxy_endpoint }}">
{% endif %}

{% if site.google_analytics.pv.cache_path %}
<meta name="pv-cache-path" content="{{ site.google_analytics.pv.cache_path | relative_url }}">
{% endif %}
{% endif %}

{% capture seo_tags %}
{% seo title=false %}
{% endcapture %}
Expand Down Expand Up @@ -76,17 +66,6 @@

<link rel="preconnect" href="https://www.googletagmanager.com" crossorigin="anonymous">
<link rel="dns-prefetch" href="https://www.googletagmanager.com">

{% if site.google_analytics.pv.proxy_endpoint %}
{% assign proxy_url = site.google_analytics.pv.proxy_endpoint
| replace: 'https://', ''
| split: '/'
| first
| prepend: 'https://'
%}
<link rel="preconnect" href="{{ proxy_url }}" crossorigin="use-credentials">
<link rel="dns-prefetch" href="{{ proxy_url }}">
{% endif %}
{% endif %}

<!-- Bootstrap -->
Expand Down
7 changes: 0 additions & 7 deletions _includes/js-selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@

<!-- layout specified -->

{% if page.layout == 'post' %}
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
<!-- pv-report needs countup.js -->
{% assign urls = urls | append: ',' | append: site.data.origin[type].countup.js %}
{% endif %}
{% endif %}

{% if page.layout == 'post' or page.layout == 'page' or page.layout == 'home' %}
{% assign urls = urls | append: ',' | append: site.data.origin[type].lazysizes.js %}

Expand Down
248 changes: 0 additions & 248 deletions _javascript/modules/components/pageviews.js

This file was deleted.

1 change: 0 additions & 1 deletion _javascript/modules/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ export { initClipboard } from './components/clipboard';
export { imgLazy } from './components/img-lazyload';
export { imgPopup } from './components/img-popup';
export { initLocaleDatetime } from './components/locale-datetime';
export { initPageviews } from './components/pageviews';
export { toc } from './components/toc';
2 changes: 0 additions & 2 deletions _javascript/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
imgPopup,
initLocaleDatetime,
initClipboard,
initPageviews,
toc
} from './modules/plugins';

Expand All @@ -16,4 +15,3 @@ imgPopup();
initLocaleDatetime();
initClipboard();
toc();
initPageviews();
10 changes: 0 additions & 10 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,6 @@ <h1 data-toc-skip>{{ page.title }}</h1>
</span>

<div>
<!-- page views -->
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
<span>
<em id="pv" class="pageviews">
<i class="fas fa-spinner fa-spin fa-fw"></i>
</em>
{{ site.data.locales[lang].post.pageview_measure }}
</span>
{% endif %}

<!-- read time -->
{% include read-time.html content=content prompt=true lang=lang %}
</div>
Expand Down
Loading