1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 05:41:31 +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

View File

@@ -1,6 +0,0 @@
---
---
{
"proxyUrl": "{{ site.google_analytics.proxy_url }}"
}

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 }}';

View File

@@ -1,4 +1,5 @@
---
layout: compress
---
[