Skip to content

Commit

Permalink
灯箱js只在内容页加载
Browse files Browse the repository at this point in the history
  • Loading branch information
Liudon authored Sep 4, 2023
1 parent 3c941b6 commit f15165f
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions layouts/partials/extend_footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@
京ICP备13029522号-2</a></span>
</footer>

<script src="//liudon.com/analytics/vue.js" async></script>
{{- if .Content }}
<script src="//tokinx.github.io/ViewImage/view-image.min.js" async></script>
<script>
function initViewImage() {
window.ViewImage && ViewImage.init('.post-content img');
}

if (document.readyState === 'complete') {
initViewImage();
} else {
window.addEventListener('load', initViewImage);
}

function initViewImage() {
window.ViewImage && ViewImage.init('.post-content img');
}

if (document.readyState === 'complete') {
initViewImage();
} else {
window.addEventListener('load', initViewImage);
}
</script>
{{- end }}
<script src="//liudon.com/analytics/vue.js" async></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
Expand Down

0 comments on commit f15165f

Please sign in to comment.