Skip to content

Commit

Permalink
Add debug variable for toggle different html heads
Browse files Browse the repository at this point in the history
  • Loading branch information
apqx committed Nov 21, 2023
1 parent f86b1ff commit 3760ed3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
25 changes: 7 additions & 18 deletions _includes/head-common.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,11 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@300;400;500;700&family=Noto+Sans+SC:wght@300;400;500;700&family=Ma+Shan+Zheng&family=Noto+Color+Emoji&display=swap" rel="stylesheet">
{%- comment %}
<!-- css和js文件由内部的npm工程输出 -->
<!-- only for test -->
<link rel="stylesheet" href="{{ "/npm/dist/apqx-v2.1.6.css" }}" />
<script type="text/javascript" src="{{ "/npm/dist/apqx-v2.1.6.js" }}"></script>

{%- endcomment %}
<!-- for publish -->
<link rel="stylesheet" href="https://apqx-host.oss-cn-hangzhou.aliyuncs.com/blog/apqx-v2.1.6.css" />
<script type="text/javascript" src="https://apqx-host.oss-cn-hangzhou.aliyuncs.com/blog/apqx-v2.1.6.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<!-- close it when on test -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-GDLCDFZXBF"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-GDLCDFZXBF');
</script>
<!-- css和js文件由内部的npm工程输出 -->
{% assign debug = false %}
{% if debug == true %}
{% include head-debug.html %}
{% else %}
{% include head-release.html %}
{% endif %}
3 changes: 3 additions & 0 deletions _includes/head-debug.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- only for debug -->
<link rel="stylesheet" href="{{ "/npm/dist/apqx-v2.1.6.css" }}" />
<script type="text/javascript" src="{{ "/npm/dist/apqx-v2.1.6.js" }}"></script>
12 changes: 12 additions & 0 deletions _includes/head-release.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- for publish -->
<link rel="stylesheet" href="https://apqx-host.oss-cn-hangzhou.aliyuncs.com/blog/apqx-v2.1.6.css" />
<script type="text/javascript" src="https://apqx-host.oss-cn-hangzhou.aliyuncs.com/blog/apqx-v2.1.6.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<!-- close it when on test -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-GDLCDFZXBF"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-GDLCDFZXBF');
</script>

0 comments on commit 3760ed3

Please sign in to comment.