Make configuration more flexible.

This commit is contained in:
Cotes Chung 2019-12-19 03:33:43 +08:00
parent 3422e2a66f
commit 1f8bfdf257
3 changed files with 10 additions and 5 deletions

View File

@ -47,9 +47,11 @@ google_analytics:
# The Google Analytics pageviews switch.
# DO NOT enable it unless you know how to deploy the Google Analytics superProxy.
pv: false
# superProxy Url, only valid when `google_analytics.pv` is set to 'true'
# superProxy baseURL and URL, only valid when `google_analytics.pv` is set to 'true'
proxy_baseurl: ''
proxy_url: ''
disqus:
shortname: 'disqus' # Change to your Disqus shortname. https://help.disqus.com/en/articles/1717111-what-s-a-shortname
comments: true # boolean type, the global switch for posts comments.

View File

@ -31,9 +31,9 @@
<link rel="preconnect" href="https://www.googletagmanager.com" crossorigin="anonymous">
<link rel="dns-prefetch" href="https://www.googletagmanager.com">
{% if site.google_analytics.proxy_url and site.google_analytics.pv %}
<link rel="preconnect" href="{{ site.google_analytics.proxy_url }}" crossorigin="use-credentials">
<link rel="dns-prefetch" href="{{ site.google_analytics.proxy_url }}">
{% if site.google_analytics.proxy_baseurl and site.google_analytics.pv %}
<link rel="preconnect" href="{{ site.google_analytics.proxy_baseurl }}" crossorigin="use-credentials">
<link rel="dns-prefetch" href="{{ site.google_analytics.proxy_baseurl }}">
{% endif %}
{% endif %}

View File

@ -1 +1,4 @@
{"proxyUrl":"https://your-gae.appspot.com/query?id=the_secrt_id"}
---
---
{"proxyUrl":"{{ site.google_analytics.proxy_url }}"}