Skip to content

Commit

Permalink
Develop astro nacos (#493)
Browse files Browse the repository at this point in the history
* fix: 🐛 搜索引擎老路由兼容

* feat: 🎸 add autolog
  • Loading branch information
heimanba authored Jan 17, 2024
1 parent 1387338 commit 6e27165
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/components/starlight/Head.astro
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ const head = createHead(headDefaults, config.head, data.head);
))
}


<!--初始化SDK-->
<script>
(function (w, d, s, q, i) {
Expand All @@ -154,9 +153,12 @@ const head = createHead(headDefaults, config.head, data.head);
t.src =
'//g.alicdn.com/aes/??tracker/3.3.3/index.js,tracker-plugin-pv/3.0.5/index.js,tracker-plugin-event/3.0.0/index.js,tracker-plugin-autolog/3.0.3/index.js,tracker-plugin-survey/3.0.3/index.js';
t.onload = function () {
if (window.location.hostname !== 'nacos.io') {
return;
}
window.AES_CONFIG = window.AES_CONFIG || {
// 判断当前环境
env: window?.location?.href.includes('localhost')? 'daily' :'prod',
env: 'prod',
};
window.aes = new AES({
pid: 'e7WQkK',
Expand All @@ -170,7 +172,7 @@ const head = createHead(headDefaults, config.head, data.head);
),
aes.use(AESPluginEvent, window.AESPluginEventConfig || {}),
aes.use(AESPluginSurvey, window.AESPluginEventConfig || {}),
// aes.use(AESPluginAutolog, window.AESPluginAutologConfig || {}),
aes.use(AESPluginAutolog, window.AESPluginAutologConfig || {}),
];
};
setTimeout(function () {
Expand All @@ -190,7 +192,8 @@ const head = createHead(headDefaults, config.head, data.head);
</script>

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-0YDFJ7LX7F"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-0YDFJ7LX7F"
></script>

<script>
window.dataLayer = window.dataLayer || [];
Expand Down
2 changes: 1 addition & 1 deletion template/404.startlight.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ const route = generateRouteData({
window.location.pathname = '/docs'+ '/latest' + pathname.split('/docs').join('')
}
}
</script>
</script>

0 comments on commit 6e27165

Please sign in to comment.