mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 22:17:06 +08:00
Merge branch 'dev' of https://github.com/jerryc127/hexo-theme-butterfly into dev
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +1,2 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
.DS_Store
|
node_modules/
|
||||||
|
|||||||
@@ -702,6 +702,12 @@ umami_analytics:
|
|||||||
# Umami Cloud (API key) / self-hosted Umami (token)
|
# Umami Cloud (API key) / self-hosted Umami (token)
|
||||||
token:
|
token:
|
||||||
|
|
||||||
|
# https://www.googletagmanager.com/
|
||||||
|
google_tag_manager:
|
||||||
|
tag_id:
|
||||||
|
# optional
|
||||||
|
domain:
|
||||||
|
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
# Advertisement
|
# Advertisement
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|||||||
@@ -55,3 +55,7 @@ div
|
|||||||
script(async data-pjax src= theme.asset.busuanzi || '//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js')
|
script(async data-pjax src= theme.asset.busuanzi || '//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js')
|
||||||
|
|
||||||
!= partial('includes/third-party/search/index', {}, { cache: true })
|
!= partial('includes/third-party/search/index', {}, { cache: true })
|
||||||
|
|
||||||
|
if (theme.google_tag_manager && theme.google_tag_manager.tag_id)
|
||||||
|
noscript
|
||||||
|
iframe(src=`${theme.google_tag_manager.domain ? theme.google_tag_manager.domain : 'https://www.googletagmanager.com'}/ns.html?id=${theme.google_tag_manager.tag_id}` height="0" width="0" style="display:none;visibility:hidden")
|
||||||
@@ -32,3 +32,14 @@ if theme.microsoft_clarity
|
|||||||
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
|
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
|
||||||
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
|
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
|
||||||
})(window, document, "clarity", "script", "!{theme.microsoft_clarity}");
|
})(window, document, "clarity", "script", "!{theme.microsoft_clarity}");
|
||||||
|
|
||||||
|
if (theme.google_tag_manager && theme.google_tag_manager.tag_id)
|
||||||
|
script.
|
||||||
|
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||||
|
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||||
|
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||||
|
"!{theme.google_tag_manager.domain ? theme.google_tag_manager.domain : 'https://www.googletagmanager.com'}/gtm.js?id="+i+dl;f.parentNode.insertBefore(j,f);
|
||||||
|
})(window,document,'script','dataLayer','!{theme.google_tag_manager.tag_id}');
|
||||||
|
btf.addGlobalFn('pjaxComplete', () => {
|
||||||
|
dataLayer.push({'event': 'pjaxComplete', 'page_title': document.title, 'page_location': location.href, 'page_path': window.location.pathname});
|
||||||
|
}, 'google_tag_manager');
|
||||||
@@ -23,8 +23,10 @@
|
|||||||
"email": "my@crazywong.com"
|
"email": "my@crazywong.com"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"hexo-renderer-pug": "^3.0.0",
|
||||||
"hexo-renderer-stylus": "^3.0.1",
|
"hexo-renderer-stylus": "^3.0.1",
|
||||||
"hexo-renderer-pug": "^3.0.0"
|
"hexo-util": "^3.3.0",
|
||||||
|
"moment-timezone": "^0.5.48"
|
||||||
},
|
},
|
||||||
"homepage": "https://butterfly.js.org/",
|
"homepage": "https://butterfly.js.org/",
|
||||||
"author": "Jerry <my@crazywong.com>",
|
"author": "Jerry <my@crazywong.com>",
|
||||||
|
|||||||
@@ -388,6 +388,10 @@ hexo.extend.filter.register('before_generate', () => {
|
|||||||
crisp: {
|
crisp: {
|
||||||
website_id: null
|
website_id: null
|
||||||
},
|
},
|
||||||
|
google_tag_manager: {
|
||||||
|
tag_id: null,
|
||||||
|
domain: 'https://www.googletagmanager.com'
|
||||||
|
},
|
||||||
baidu_analytics: null,
|
baidu_analytics: null,
|
||||||
google_analytics: null,
|
google_analytics: null,
|
||||||
cloudflare_analytics: null,
|
cloudflare_analytics: null,
|
||||||
|
|||||||
Reference in New Issue
Block a user