1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 00:50:05 +08:00

chore(website): use gtag.js

This commit is contained in:
wsdjeg 2022-04-20 23:40:20 +08:00
parent a36eb377db
commit 37ed3bd235

View File

@ -10,12 +10,15 @@
<title>{{ page.title }} | SpaceVim</title> <title>{{ page.title }} | SpaceVim</title>
<meta name="baidu-site-verification" content="AN14j6xQVd" /> <meta name="baidu-site-verification" content="AN14j6xQVd" />
<!-- This is for google search console --> <!-- This is for google search console -->
<meta name="google-site-verification" content="2QrXyd7Wz5_ahXqefiYC_4-HvynQrefWDWORb7EjLCU" /> <meta
name="google-site-verification"
content="2QrXyd7Wz5_ahXqefiYC_4-HvynQrefWDWORb7EjLCU"
/>
<meta name="yandex-verification" content="8de09d07572b8dcc" /> <meta name="yandex-verification" content="8de09d07572b8dcc" />
<meta name="author" content="Shidong Wang" /> <meta name="author" content="Shidong Wang" />
<meta name="description" content="{{ page.description }}" /> <meta name="description" content="{{ page.description }}" />
{% if page.type %} {% if page.type %}
<meta property="og:type" content="{{ page.type }}"/> <meta property="og:type" content="{{ page.type }}" />
{% else %} {% else %}
<meta property="og:type" content="webpage" /> <meta property="og:type" content="webpage" />
{% endif %} {% endif %}
@ -42,13 +45,13 @@
{% if page.lang == "zh" %} {% if page.lang == "zh" %}
<script> <script>
((window.gitter = {}).chat = {}).options = { ((window.gitter = {}).chat = {}).options = {
room: "SpaceVim/cn" room: "SpaceVim/cn",
}; };
</script> </script>
{% else %} {% else %}
<script> <script>
((window.gitter = {}).chat = {}).options = { ((window.gitter = {}).chat = {}).options = {
room: "SpaceVim/SpaceVim" room: "SpaceVim/SpaceVim",
}; };
</script> </script>
{% endif %} {% endif %}
@ -66,7 +69,7 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
{% endif %} {% endif %}
<script src="{{ '/assets/js/respond.js' | relative_url }}"></script> <script src="{{ '/assets/js/respond.js' | relative_url }}"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head> </head>
<body> <body>
@ -78,14 +81,21 @@
width="100" width="100"
height="100" height="100"
viewBox="0 0 250 250" viewBox="0 0 250 250"
style="fill:#64CEAA; color:#fff; position: absolute; top: 0; border: 0; right: 0;" style="
fill: #64ceaa;
color: #fff;
position: absolute;
top: 0;
border: 0;
right: 0;
"
aria-hidden="true" aria-hidden="true"
> >
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path> <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path <path
d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
fill="currentColor" fill="currentColor"
style="transform-origin: 130px 106px;" style="transform-origin: 130px 106px"
class="octo-arm" class="octo-arm"
></path> ></path>
<path <path
@ -172,8 +182,8 @@
repo: "SpaceVim-comments", repo: "SpaceVim-comments",
oauth: { oauth: {
client_id: "{{ site.gitment_client_id }}", client_id: "{{ site.gitment_client_id }}",
client_secret: "{{ site.gitment_client_secret }}" client_secret: "{{ site.gitment_client_secret }}",
} },
}); });
gitment.render("container"); gitment.render("container");
</script> </script>
@ -183,22 +193,19 @@
</div> </div>
{% if site.google_analytics %} {% if site.google_analytics %}
<script type="text/javascript"> <!-- Global site tag (gtag.js) - Google Analytics -->
var gaJsHost = <script
"https:" == document.location.protocol ? "https://ssl." : "http://www."; async
document.write( src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"
unescape( ></script>
"%3Cscript src='" + <script>
gaJsHost + window.dataLayer = window.dataLayer || [];
"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E" function gtag() {
) dataLayer.push(arguments);
); }
</script> gtag("js", new Date());
<script type="text/javascript">
try { gtag("config", "{{ site.google_analytics }}");
var pageTracker = _gat._getTracker("{{ site.google_analytics }}");
pageTracker._trackPageview();
} catch (err) {}
</script> </script>
{% endif %} {% endif %}
<script <script
@ -216,7 +223,7 @@
>帮助改进本页面</a >帮助改进本页面</a
> >
</span> </span>
<br> <br />
<input <input
id="textbox" id="textbox"
type="text" type="text"
@ -233,7 +240,7 @@
>Help improve this page</a >Help improve this page</a
> >
</span> </span>
<br> <br />
<input <input
id="textbox" id="textbox"
type="text" type="text"