1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2026-01-13 10:26:43 +00:00

Improved the PV fetching experience.

This commit is contained in:
Cotes Chung
2020-04-01 20:33:49 +08:00
parent 9f6173231b
commit 1ce1455ce2
9 changed files with 155 additions and 38 deletions

13
assets/data/pv-data.json Normal file
View File

@@ -0,0 +1,13 @@
---
layout: compress
---
const proxyData = '{"url": "{{ site.google_analytics.pv.proxy_endpoint }}"}';
{%- capture pv_data -%}
{%- if site.google_analytics.pv.cache and site.google_analytics.pv.enabled -%}
{% include_relative pageviews.json %}
{%- endif -%}
{%- endcapture -%}
const pageviews = '{{ pv_data }}';