mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-18 13:44:15 +00:00
Fix PV display when baseurl exists
This commit is contained in:
@@ -12,3 +12,5 @@ const proxyEndpoint = "{{ site.google_analytics.pv.proxy_endpoint }}";
|
||||
{% endif %}
|
||||
|
||||
const pvCacheEnabled = {{ enabled }};
|
||||
|
||||
const pvCacheData = "{{ '/assets/js/data/pageviews.json' | relative_url }}";
|
||||
|
||||
@@ -173,9 +173,9 @@ function fetchProxyPageviews() {
|
||||
|
||||
|
||||
function fetchPageviews(fetchOrigin = true, filterOrigin = false) {
|
||||
/* pvCacheEnabled › see: /assets/js/_pv-config.js */
|
||||
/* pvCacheEnabled, pvCacheData › see: /assets/js/_pv-config.js */
|
||||
if (pvCacheEnabled && fetchOrigin) {
|
||||
fetch("/assets/js/data/pageviews.json")
|
||||
fetch(pvCacheData)
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
if (filterOrigin) {
|
||||
|
||||
Reference in New Issue
Block a user