1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 05:41:31 +00:00

Fix the PV fetching failed when local cache is disabled

also improve the PV report logic
This commit is contained in:
Cotes Chung
2021-04-06 01:04:09 +08:00
parent 991f53f8b2
commit 48e4c7e6d3
3 changed files with 38 additions and 35 deletions

View File

@@ -7,19 +7,20 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{% if page.layout == 'home' or page.layout == 'post' %}
<meta name="pv-cache-enabled" content="{{ site.google_analytics.pv.enabled }}">
{% if site.google_analytics.pv.enabled %}
{% if site.google_analytics.pv.proxy_endpoint != ''
and site.google_analytics.pv.proxy_endpoint %}
and 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 %}
<meta name="pv-cache-data" content="{{ '/assets/js/data/pageviews.json' | relative_url }}">
<meta name="pv-cache-path" content="{{ '/assets/js/data/pageviews.json' | relative_url }}">
{% endif %}
{% endif %}
{% endif %}
{% seo title=false %}